diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2016-09-23 05:46:01 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2016-09-23 09:09:57 -0400 |
commit | 8047c2f448c6aa48bf9d6b578e8b1806fc37ccaf (patch) | |
tree | bd8f4124f7764277e943ac507ac244444b02b215 /src/mod_deflate.c | |
parent | d2b7c7bad289359298235d595788b5952d222d2e (diff) | |
download | lighttpd-git-8047c2f448c6aa48bf9d6b578e8b1806fc37ccaf.tar.gz |
fix errors detected by Coverity Scan
fix potential NULL pointer dereference in mod_deflate.c
remove logically dead code in connection-glue.c
add coverity annotations to see if some issues will be reclassified
Diffstat (limited to 'src/mod_deflate.c')
-rw-r--r-- | src/mod_deflate.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mod_deflate.c b/src/mod_deflate.c index 9605081b..32fe26cd 100644 --- a/src/mod_deflate.c +++ b/src/mod_deflate.c @@ -684,9 +684,7 @@ static int mod_deflate_file_chunk(server *srv, connection *con, handler_ctx *hct return -1; } -#ifdef FD_CLOEXEC - fcntl(c->file.fd, F_SETFD, FD_CLOEXEC); -#endif + fd_close_on_exec(c->file.fd); } abs_offset = c->file.start + c->offset; @@ -1075,8 +1073,7 @@ CONNECTION_FUNC(mod_deflate_handle_response_start) { /* check ETag as is done in http_response_handle_cachable() * (slightly imperfect (close enough?) match of ETag "000000" to "000000-gzip") */ ds = (data_string *)array_get_element(con->response.headers, "ETag"); - if (buffer_string_is_empty(ds->value)) ds = NULL; - if (NULL != ds) { + if (!buffer_string_is_empty(ds->value)) { etaglen = buffer_string_length(ds->value); if (etaglen && con->http_status < 300 /*(want 2xx only)*/ |