summaryrefslogtreecommitdiff
path: root/package/uhttpd/src
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-09-09 20:15:02 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-09-09 20:15:02 +0000
commit8c59fddb365bcd9a8ab6ce8ecc0c27b8026c0fd4 (patch)
tree8f411598966424ee49349f5da6ac769006dcb592 /package/uhttpd/src
parent9d4993c5b6517becf40cd41a00063020b2f4b594 (diff)
[package] uhttpd: break tight loop when receiving eof during header reading (#7904)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22988 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/uhttpd/src')
-rw-r--r--package/uhttpd/src/uhttpd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c
index 6f5e616345..a818e1c450 100644
--- a/package/uhttpd/src/uhttpd.c
+++ b/package/uhttpd/src/uhttpd.c
@@ -401,6 +401,10 @@ static struct http_request * uh_http_header_recv(struct client *cl)
{
ensure_out(rlen = uh_tcp_recv(cl, bufptr, rlen));
+ /* unexpected eof - #7904 */
+ if( rlen == 0 )
+ return NULL;
+
blen -= rlen;
bufptr += rlen;
}