1
0
mirror of https://github.com/mirror/wget.git synced 2025-04-14 21:40:42 +08:00

* src/recur.c (retrieve_tree): Fix possible NULL dereference

Reported-by: Coverity
This commit is contained in:
Tim Rühsen 2016-09-08 13:04:35 +02:00
parent b7b67e23cd
commit 03da900c5b

View File

@ -438,10 +438,15 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
struct url *url_parsed = url_parse (url, NULL, i, true);
struct iri *ci;
char *referer_url = url;
bool strip_auth = (url_parsed != NULL
&& url_parsed->user != NULL);
bool strip_auth;
assert (url_parsed != NULL);
if (!url_parsed)
continue;
strip_auth = (url_parsed && url_parsed->user);
/* Strip auth info if present */
if (strip_auth)
referer_url = url_string (url_parsed, URL_AUTH_HIDE);