svn commit: trunk/busybox/networking

vda at busybox.net vda at busybox.net
Sat Oct 13 19:34:21 PDT 2007


Author: vda
Date: 2007-10-13 19:34:20 -0700 (Sat, 13 Oct 2007)
New Revision: 20254

Log:
httpd: fix bug where we were trying to read more POSTDATA than content-length



Modified:
   trunk/busybox/networking/httpd.c


Changeset:
Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2007-10-14 01:37:53 UTC (rev 20253)
+++ trunk/busybox/networking/httpd.c	2007-10-14 02:34:20 UTC (rev 20254)
@@ -1051,6 +1051,17 @@
 	 * and send it to the peer. So please no SIGPIPEs! */
 	signal(SIGPIPE, SIG_IGN);
 
+	// We inconsistently handle a case when more POSTDATA from network
+	// is coming than we expected. We may give *some part* of that
+	// extra data to CGI.
+
+	//if (hdr_cnt > post_len) {
+	//	/* We got more POSTDATA from network than we expected */
+	//	hdr_cnt = post_len;
+	//}
+	post_len -= hdr_cnt;
+	/* post_len - number of POST bytes not yet read from network */
+
 	/* NB: breaking out of this loop jumps to log_and_exit() */
 	out_cnt = 0;
 	while (1) {



More information about the busybox-cvs mailing list