| Summary: | busybox wget segfaults with http_proxy environment set | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Natanael Copa <ncopa> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.16.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | i386 | Target: | i386 |
| Build: | |||
|
Description
Natanael Copa
2010-02-08 11:09:31 UTC
(In reply to comment #0) > To reproduce: > > (start a http proxy some place) > $ export http_proxy=http://proxy:8080 > $ wget http://google.com > Connecting to proxy:8080 (10.65.64.4:8080) > Segmentation fault > > Originally reported here: > http://redmine.alpinelinux.org/issues/show/264 > Haven't seen any problem here ... I just ran a test with target i686 host amd64 using chroot. I'm using wget from busybox. What's yours ? Seems like running as './busybox wget' does not trigger the bug, while 'ln -s ./busybox wget && ./wget' does.
Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb76057da in strlen () from /lib/libc.so.0
(gdb) bt
#0 0xb76057da in strlen () from /lib/libc.so.0
#1 0xb76898db in base64enc_512 (buf=0xbfffed54 "", str=<value optimized out>)
at networking/wget.c:150
#2 0xb768a2f1 in wget_main (argc=2, argv=0xbffff0c4) at networking/wget.c:685
#3 0xb76673a0 in run_applet_no_and_exit (applet_no=266, argv=0xbffff0c4)
at libbb/appletlib.c:746
#4 0xb76673dd in run_applet_and_exit (name=0xbffff242 "wget", argv=0xbffff0c4)
at libbb/appletlib.c:753
#5 0xb76676de in main (argc=2, argv=0xbffff0c4) at libbb/appletlib.c:808
(gdb)
and i use uclibc-0.9.30.2 (alpinelinux) I apologize that it is by-effect of commit be168b119750beacc0d0212607c6fa3ee87f238c
try patch below
--- a/networking/wget.c 2010-02-09 22:17:50.000000000 +0300
+++ b/networking/wget.c 2010-02-09 22:18:32.000000000 +0300
@@ -590,6 +590,7 @@ int wget_main(int argc UNUSED_PARAM, cha
if (use_proxy) {
proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy");
if (proxy && proxy[0]) {
+ server.user = NULL;
parse_url(proxy, &server);
} else {
use_proxy = 0;
> try patch below
> --- a/networking/wget.c 2010-02-09 22:17:50.000000000 +0300
> +++ b/networking/wget.c 2010-02-09 22:18:32.000000000 +0300
> @@ -590,6 +590,7 @@ int wget_main(int argc UNUSED_PARAM, cha
> if (use_proxy) {
> proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy");
> if (proxy && proxy[0]) {
> + server.user = NULL;
> parse_url(proxy, &server);
> } else {
> use_proxy = 0;
>
works.
Please commit this to git master and 1_16_stable branch
thanks!
Applied to git, thanks! |