summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-07-07 16:43:27 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-07-07 16:43:27 +0000
commite3265898d9993fd951bc89a46c8ce5fe7b5faeca (patch)
treefeb339cc626b0372589ed1f91299db5a4e093b5f
parent6b3a770d363bf331306d93dfdf7feacbed0fbb86 (diff)
downloaduhttpd-e3265898d9993fd951bc89a46c8ce5fe7b5faeca.tar.gz
[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/package/uhttpd/src@32644 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--uhttpd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/uhttpd.c b/uhttpd.c
index 73f6e03..3237fba 100644
--- a/uhttpd.c
+++ b/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)