Browse Source

[core] fix crash when using lighttpd -1 with pipes (fixes #3117)

(thx povcfe-bug)

In some scenarios with lighttpd -1 on pipes, the event handler
associated with the connection (con) will have been cleaned up,
and a pending event on the one-off oneshot_fdn will not yet have
been handled, leading to a crash.  lighttpd typically is used to
handle requests on sockets, not pipes.  With nc (netcat), the
requests might be sent over pipes.  The bug occurred with the
accommodations made in lighttpd to handle the request over pipes.

x-ref:
  "Trigger crash when using lighttpd -1 with pipes"
  https://redmine.lighttpd.net/issues/3117
master
Glenn Strauss 2 months ago
parent
commit
5ca9eca8c4
  1. 2
      src/server.c

2
src/server.c

@ -444,7 +444,7 @@ static handler_t server_oneshot_handle_fdevent(void *context, int revents) {
fdevent_fdnode_event_set(con->srv->ev, oneshot_fdn, n);
fdnode * const fdn = con->fdn; /* fdn->ctx == con */
handler_t rc = ((fdevent_handler)NULL != fdn->handler)
handler_t rc = (fdn && (fdevent_handler)NULL != fdn->handler)
? (*fdn->handler)(con, revents)
: HANDLER_FINISHED;

Loading…
Cancel
Save