summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-08-28 22:03:19 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-08-28 22:03:19 +0000
commite7bdfccb3f1bae2159f14f65be90e6966c21c725 (patch)
tree47238b16fe64a7d0b3ed79e082ad35f9358ac2c4 /networking/wget.c
parent83e4a5bccf3b06f9b2cbd708d48d1ea0602297c6 (diff)
downloadbusybox-w32-e7bdfccb3f1bae2159f14f65be90e6966c21c725.tar.gz
busybox-w32-e7bdfccb3f1bae2159f14f65be90e6966c21c725.tar.bz2
busybox-w32-e7bdfccb3f1bae2159f14f65be90e6966c21c725.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@ ----------------------------------------------------------------------
Diffstat (limited to 'networking/wget.c')
-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