diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-09-09 20:15:02 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-09-09 20:15:02 +0000 |
commit | 70dff7070ed289d1fd8078a3bf80713ed959b20d (patch) | |
tree | efc1f76e9f5c7e69a16c8017cfcf57f9ca453ac4 /package/uhttpd/src | |
parent | 7a54becd63b4a572183ce4a8afc883e3dfdc1288 (diff) | |
download | mtk-20170518-70dff7070ed289d1fd8078a3bf80713ed959b20d.zip mtk-20170518-70dff7070ed289d1fd8078a3bf80713ed959b20d.tar.gz mtk-20170518-70dff7070ed289d1fd8078a3bf80713ed959b20d.tar.bz2 |
uhttpd: break tight loop when receiving eof during header reading (#7904)
SVN-Revision: 22988
Diffstat (limited to 'package/uhttpd/src')
-rw-r--r-- | package/uhttpd/src/uhttpd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c index 6f5e616..a818e1c 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; } |