aboutsummaryrefslogtreecommitdiffstats
path: root/package/uhttpd
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-09-09 20:15:02 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-09-09 20:15:02 +0000
commita326df749e08728375b3d8d0ceb1be9e43d9b98c (patch)
tree8f411598966424ee49349f5da6ac769006dcb592 /package/uhttpd
parent6efc869322bf1dd329edda34224c52082f17cff9 (diff)
downloadupstream-a326df749e08728375b3d8d0ceb1be9e43d9b98c.tar.gz
upstream-a326df749e08728375b3d8d0ceb1be9e43d9b98c.tar.bz2
upstream-a326df749e08728375b3d8d0ceb1be9e43d9b98c.zip
[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')
-rw-r--r--package/uhttpd/Makefile2
-rw-r--r--package/uhttpd/src/uhttpd.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/package/uhttpd/Makefile b/package/uhttpd/Makefile
index 086c294580..e37fa90ec4 100644
--- a/package/uhttpd/Makefile
+++ b/package/uhttpd/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd
-PKG_RELEASE:=17
+PKG_RELEASE:=18
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS := libcyassl liblua
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;
}