diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-18 18:00:51 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-18 18:00:51 +0000 |
commit | d60a279c341c360f34b8b37a8056a23753187c2c (patch) | |
tree | f43734ec0996630daa68f05fd1394393520f6f2d | |
parent | 5483a19fc3a781a792f80b27782f9aa9e3e03746 (diff) | |
download | busybox-w32-d60a279c341c360f34b8b37a8056a23753187c2c.tar.gz busybox-w32-d60a279c341c360f34b8b37a8056a23753187c2c.tar.bz2 busybox-w32-d60a279c341c360f34b8b37a8056a23753187c2c.zip |
wget: fix access-to-ro memory
-rw-r--r-- | networking/wget.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/wget.c b/networking/wget.c index cc768db8b..e46539fd9 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -543,7 +543,9 @@ static void parse_url(char *src_url, struct host_info *h) | |||
543 | p = strchr(h->host, '?'); if (!sp || (p && sp > p)) sp = p; | 543 | p = strchr(h->host, '?'); if (!sp || (p && sp > p)) sp = p; |
544 | p = strchr(h->host, '#'); if (!sp || (p && sp > p)) sp = p; | 544 | p = strchr(h->host, '#'); if (!sp || (p && sp > p)) sp = p; |
545 | if (!sp) { | 545 | if (!sp) { |
546 | h->path = ""; | 546 | /* must be writable because of bb_get_last_path_component() */ |
547 | static char nullstr[] = ""; | ||
548 | h->path = nullstr; | ||
547 | } else if (*sp == '/') { | 549 | } else if (*sp == '/') { |
548 | *sp = '\0'; | 550 | *sp = '\0'; |
549 | h->path = sp + 1; | 551 | h->path = sp + 1; |