Browse Source

[mod_magnet] avoid infinite loop in atpanic (fixes #3065)

(thx axe34)

Be more careful inside the atpanic handler to avoid an infinite loop
that repeats the call to the atpanic handler

x-ref:
  "Segmentation Fault due to Empty String on Mod Magnet"
  https://redmine.lighttpd.net/issues/3065
master
Glenn Strauss 2 months ago
parent
commit
5c386efe8f
  1. 4
      src/mod_magnet.c

4
src/mod_magnet.c

@ -365,9 +365,9 @@ static int magnet_stat(lua_State *L) {
static int magnet_atpanic(lua_State *L) {
const_buffer cb = magnet_checkconstbuffer(L, 1);
request_st * const r = magnet_get_request(L);
log_error(r->conf.errh, __FILE__, __LINE__, "(lua-atpanic) %s", cb.ptr);
log_error(r->conf.errh, __FILE__, __LINE__, "(lua-atpanic) %s",
lua_isstring(L, 1) ? lua_tostring(L, 1) : "");
longjmp(exceptionjmp, 1);
}

Loading…
Cancel
Save