diff --git a/lib/urlapi.c b/lib/urlapi.c index 1ee9f2769d..060ccec151 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -249,6 +249,8 @@ static CURLUcode redirect_url(const char *base, const char *relurl, /* protsep points to the start of the hostname, after [scheme]:// */ const char *protsep = base + strlen(u->scheme) + 3; DEBUGASSERT(base && relurl && u); /* all set here */ + if(!base) + return CURLUE_MALFORMED_INPUT; /* should never happen */ /* handle different relative URL types */ switch(relurl[0]) {