summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2015-07-05 20:19:17 +0000
committerStefan Bühler <stbuehler@web.de>2015-07-05 20:19:17 +0000
commitcfc88cf8f22e015d9e65e292bae6e0989a22c016 (patch)
tree0c5dd5ce681af08b0492d8ad84c9b329c25bc9ad
parent9f05b61ab4fe96d5e8ca376e0debd1543bfb419c (diff)
downloadlighttpd-git-cfc88cf8f22e015d9e65e292bae6e0989a22c016.tar.gz
check pointer before usage in new etag compare
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2995 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--src/etag.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/etag.c b/src/etag.c
index adc8a04c..27542d06 100644
--- a/src/etag.c
+++ b/src/etag.c
@@ -20,7 +20,7 @@ int etag_is_equal(buffer *etag, const char *line, int weak_ok) {
} state = START;
const char *current;
- const char *tok_start = etag->ptr;
+ const char *tok_start;
const char *tok = NULL;
int matched;
@@ -29,6 +29,7 @@ int etag_is_equal(buffer *etag, const char *line, int weak_ok) {
}
if (!etag || buffer_string_is_empty(etag)) return 0;
+ tok_start = etag->ptr;
if ('W' == tok_start[0]) {
if (!weak_ok || '/' != tok_start[1]) return 0; /* bad etag */