From c5737093db9e7d8db75c7d6b32ae4c3886b7903a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sun, 5 Jul 2015 22:00:14 +0000 Subject: [mod_magnet] fix segfault when accessing not existing lighty.req_env[] entry (found by coverity) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Stefan Bühler git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2998 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_magnet.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1