From 03da900c5be6b43ebf1edb335b9b51c8c249d76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> Date: Thu, 8 Sep 2016 13:04:35 +0200 Subject: [PATCH] * src/recur.c (retrieve_tree): Fix possible NULL dereference Reported-by: Coverity --- src/recur.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/recur.c b/src/recur.c index 2b17e725..a195dd44 100644 --- a/src/recur.c +++ b/src/recur.c @@ -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);