Browse Source

[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
svn/tags/lighttpd-1.4.36
Stefan Bühler 7 years ago
parent
commit
c5737093db
  1. 1
      NEWS
  2. 2
      src/mod_magnet.c

1
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

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

Loading…
Cancel
Save