uhttpd: break tight loop when receiving eof during header reading (#7904)
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 9 Sep 2010 20:15:02 +0000 (20:15 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 9 Sep 2010 20:15:02 +0000 (20:15 +0000)
SVN-Revision: 22988

package/uhttpd/Makefile
package/uhttpd/src/uhttpd.c

index 086c294580f1672509fcd3201576c082ac647a8f..e37fa90ec4ded01b215a1f35a5fb099ce6cfc793 100644 (file)
@@ -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
index 6f5e616345121205a0a4fb4a93daaaab33108854..a818e1c4507e58ff55f501b7bb28a7462df57e45 100644 (file)
@@ -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;
                        }