aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-28 22:03:19 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-28 22:03:19 +0000
commita4d0433e41700244a4c2e5d4c84f27a7a3526c08 (patch)
tree47238b16fe64a7d0b3ed79e082ad35f9358ac2c4 /networking
parent47dffd3ed441baec2f8a7b40b27f8673377540a5 (diff)
downloadbusybox-w32-a4d0433e41700244a4c2e5d4c84f27a7a3526c08.tar.gz
busybox-w32-a4d0433e41700244a4c2e5d4c84f27a7a3526c08.tar.bz2
busybox-w32-a4d0433e41700244a4c2e5d4c84f27a7a3526c08.zip
"When the initial request by wget is responded by a 3XX redirect
response sent in chunked transfer encoding, the code path to resubmit the request to the redirected URL forgets to reset got_clen and chunked variables in the loop. If the redirected URL does not use chunked transfer encoding, this causes the code that slurps the body of the response to incorrectly try to parse out the chunk length which does not exist." - junkio@ ---------------------------------------------------------------------- git-svn-id: svn://busybox.net/trunk/busybox@7275 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'networking')
-rw-r--r--networking/wget.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 586a7e0d4..4a10a307e 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -295,6 +295,8 @@ int wget_main(int argc, char **argv)
295 * HTTP session 295 * HTTP session
296 */ 296 */
297 do { 297 do {
298 got_clen = chunked = 0;
299
298 if (! --try) 300 if (! --try)
299 close_delete_and_die("too many redirections"); 301 close_delete_and_die("too many redirections");
300 302
@@ -337,7 +339,8 @@ int wget_main(int argc, char **argv)
337 /* 339 /*
338 * Retrieve HTTP response line and check for "200" status code. 340 * Retrieve HTTP response line and check for "200" status code.
339 */ 341 */
340read_response: if (fgets(buf, sizeof(buf), sfp) == NULL) 342read_response:
343 if (fgets(buf, sizeof(buf), sfp) == NULL)
341 close_delete_and_die("no response from server"); 344 close_delete_and_die("no response from server");
342 345
343 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) 346 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s)
@@ -816,7 +819,7 @@ progressmeter(int flag)
816 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 819 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
817 * SUCH DAMAGE. 820 * SUCH DAMAGE.
818 * 821 *
819 * $Id: wget.c,v 1.55 2003/08/28 21:55:22 bug1 Exp $ 822 * $Id: wget.c,v 1.56 2003/08/28 22:03:19 bug1 Exp $
820 */ 823 */
821 824
822 825