diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-07-01 15:01:50 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-07-01 15:05:09 +0200 |
commit | ea267d518ff55517e174b9e8514fc521e4a3b41e (patch) | |
tree | 4147db5082f88ee14341de5df48fec5cb7fd513f /networking/wget.c | |
parent | 1bf560e9c374b073757509b334eb099c59f64191 (diff) | |
download | busybox-w32-ea267d518ff55517e174b9e8514fc521e4a3b41e.tar.gz busybox-w32-ea267d518ff55517e174b9e8514fc521e4a3b41e.tar.bz2 busybox-w32-ea267d518ff55517e174b9e8514fc521e4a3b41e.zip |
wget: do not abort if "_" is encountered in a HTTP header
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c index 4eafebe40..ce2f51411 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -328,8 +328,16 @@ static char *gethdr(FILE *fp) | |||
328 | return NULL; | 328 | return NULL; |
329 | 329 | ||
330 | /* convert the header name to lower case */ | 330 | /* convert the header name to lower case */ |
331 | for (s = G.wget_buf; isalnum(*s) || *s == '-' || *s == '.'; ++s) { | 331 | for (s = G.wget_buf; isalnum(*s) || *s == '-' || *s == '.' || *s == '_'; ++s) { |
332 | /* tolower for "A-Z", no-op for "0-9a-z-." */ | 332 | /* |
333 | * No-op for 20-3f and 60-7f. "0-9a-z-." are in these ranges. | ||
334 | * 40-5f range ("@A-Z[\]^_") maps to 60-7f. | ||
335 | * "A-Z" maps to "a-z". | ||
336 | * "@[\]" can't occur in header names. | ||
337 | * "^_" maps to "~,DEL" (which is wrong). | ||
338 | * "^" was never seen yet, "_" was seen from web.archive.org | ||
339 | * (x-archive-orig-x_commoncrawl_Signature: HEXSTRING). | ||
340 | */ | ||
333 | *s |= 0x20; | 341 | *s |= 0x20; |
334 | } | 342 | } |
335 | 343 | ||