diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-07-07 16:43:27 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-07-07 16:43:27 +0000 |
commit | 1fe9e2d2cf312ce412eddf426af740e92d3558fb (patch) | |
tree | 203ab4bbec7b4f57007ff0f5642f2fb8a0427224 | |
parent | 9dee635f13023ef7c0fa7946b6a1de68a8e9a654 (diff) | |
download | upstream-1fe9e2d2cf312ce412eddf426af740e92d3558fb.tar.gz upstream-1fe9e2d2cf312ce412eddf426af740e92d3558fb.tar.bz2 upstream-1fe9e2d2cf312ce412eddf426af740e92d3558fb.zip |
[package] uhttpd: do not dispatch pipe error events, fixes use after free for cgi and lua scripts
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32644 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/uhttpd/src/uhttpd.c | 8 |
1 files changed, 6 insertions, 2 deletions
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) |