From: Jo-Philipp Wich Date: Sat, 7 Jul 2012 16:43:27 +0000 (+0000) Subject: [package] uhttpd: do not dispatch pipe error events, fixes use after free for cgi... X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=68129a0d2522a5e7f0948056f821993cb7fae9f5 [package] uhttpd: do not dispatch pipe error events, fixes use after free for cgi and lua scripts SVN-Revision: 32644 --- diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c index 73f6e03bd4..3237fbab57 100644 --- a/package/uhttpd/src/uhttpd.c +++ b/package/uhttpd/src/uhttpd.c @@ -573,9 +573,13 @@ static void uh_pipe_cb(struct uloop_fd *u, unsigned int events) { struct client *cl = container_of(u, struct client, pipe); - D("SRV: Client(%d) pipe(%d) readable\n", cl->fd.fd, cl->pipe.fd); + if (!u->error) + { + D("SRV: Client(%d) pipe(%d) readable\n", + cl->fd.fd, cl->pipe.fd); - uh_client_cb(&cl->fd, ULOOP_WRITE); + uh_client_cb(&cl->fd, ULOOP_WRITE); + } } static void uh_child_cb(struct uloop_process *p, int rv)