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);