From: Denis Vlasenko Date: Sun, 18 Mar 2007 18:00:51 +0000 (-0000) Subject: wget: fix access-to-ro memory X-Git-Tag: 1_4_2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d60a279c341c360f34b8b37a8056a23753187c2c;p=oweals%2Fbusybox.git wget: fix access-to-ro memory --- 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) p = strchr(h->host, '?'); if (!sp || (p && sp > p)) sp = p; p = strchr(h->host, '#'); if (!sp || (p && sp > p)) sp = p; if (!sp) { - h->path = ""; + /* must be writable because of bb_get_last_path_component() */ + static char nullstr[] = ""; + h->path = nullstr; } else if (*sp == '/') { *sp = '\0'; h->path = sp + 1;