summaryrefslogtreecommitdiff
path: root/src/mod_deflate.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2016-09-23 05:46:01 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2016-09-23 09:09:57 -0400
commit8047c2f448c6aa48bf9d6b578e8b1806fc37ccaf (patch)
treebd8f4124f7764277e943ac507ac244444b02b215 /src/mod_deflate.c
parentd2b7c7bad289359298235d595788b5952d222d2e (diff)
downloadlighttpd-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.c7
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)*/