From 70dff7070ed289d1fd8078a3bf80713ed959b20d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 9 Sep 2010 20:15:02 +0000 Subject: uhttpd: break tight loop when receiving eof during header reading (#7904) SVN-Revision: 22988 --- package/uhttpd/src/uhttpd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'package/uhttpd/src') 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; } -- cgit v1.2.3