aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-10-14 02:34:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-10-14 02:34:20 +0000
commit4a4575686eca96e7d393ba5c08ae3549bed2c1f0 (patch)
tree6090ec57858e4ba466b1fabb96fc515d09a27214
parent9435993b01d789ebb984457ca2ba0eec627470db (diff)
downloadbusybox-w32-4a4575686eca96e7d393ba5c08ae3549bed2c1f0.tar.gz
busybox-w32-4a4575686eca96e7d393ba5c08ae3549bed2c1f0.tar.bz2
busybox-w32-4a4575686eca96e7d393ba5c08ae3549bed2c1f0.zip
httpd: fix bug where we were trying to read more POSTDATA than content-length
-rw-r--r--networking/httpd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 61185025c..82755a08a 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1051,6 +1051,17 @@ static NOINLINE void cgi_io_loop_and_exit(int fromCgi_rd, int toCgi_wr, int post
1051 * and send it to the peer. So please no SIGPIPEs! */ 1051 * and send it to the peer. So please no SIGPIPEs! */
1052 signal(SIGPIPE, SIG_IGN); 1052 signal(SIGPIPE, SIG_IGN);
1053 1053
1054 // We inconsistently handle a case when more POSTDATA from network
1055 // is coming than we expected. We may give *some part* of that
1056 // extra data to CGI.
1057
1058 //if (hdr_cnt > post_len) {
1059 // /* We got more POSTDATA from network than we expected */
1060 // hdr_cnt = post_len;
1061 //}
1062 post_len -= hdr_cnt;
1063 /* post_len - number of POST bytes not yet read from network */
1064
1054 /* NB: breaking out of this loop jumps to log_and_exit() */ 1065 /* NB: breaking out of this loop jumps to log_and_exit() */
1055 out_cnt = 0; 1066 out_cnt = 0;
1056 while (1) { 1067 while (1) {