summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2015-07-05 22:00:14 +0000
committerStefan Bühler <stbuehler@web.de>2015-07-05 22:00:14 +0000
commitc5737093db9e7d8db75c7d6b32ae4c3886b7903a (patch)
tree0a029b43d883db2461af4d06b5a21c9ac3c20690
parent2edec6359753e55cb1cd1a824d32e20e6096b9a4 (diff)
downloadlighttpd-git-c5737093db9e7d8db75c7d6b32ae4c3886b7903a.tar.gz
[mod_magnet] fix segfault when accessing not existing lighty.req_env[] entry (found by coverity)
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2998 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r--NEWS1
-rw-r--r--src/mod_magnet.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 098a4e50..dabdedaf 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ NEWS
* show extforward re-run warning only with debug.log-request-handling (fixes #2561)
* parse If-None-Match for ETag validation (fixes #2578)
* fix memory leak in mod_status when no counters are set (found by coverity)
+ * [mod_magnet] fix segfault when accessing not existing lighty.req_env[] entry (found by coverity)
- 1.4.35 - 2014-03-12
* [network/ssl] fix build error if TLSEXT is disabled
diff --git a/src/mod_magnet.c b/src/mod_magnet.c
index 0d99fdf9..5a72ff15 100644
--- a/src/mod_magnet.c
+++ b/src/mod_magnet.c
@@ -646,7 +646,7 @@ static int magnet_cgi_get(lua_State *L) {
lua_pop(L, 1);
ds = (data_string *)array_get_element(con->environment, key);
- if (!buffer_is_empty(ds->value))
+ if (NULL != ds && !buffer_is_empty(ds->value))
lua_pushlstring(L, CONST_BUF_LEN(ds->value));
else
lua_pushnil(L);