projects
/
openwrt
/
svn-archive
/
archive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[package] uhttpd: break tight loop when receiving eof during header reading (#7904)
[openwrt/svn-archive/archive.git]
/
package
/
uhttpd
/
src
/
uhttpd.c
diff --git
a/package/uhttpd/src/uhttpd.c
b/package/uhttpd/src/uhttpd.c
index 6f5e616345121205a0a4fb4a93daaaab33108854..a818e1c4507e58ff55f501b7bb28a7462df57e45 100644
(file)
--- 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;
}