From: z2_ <88509734+z2-2z@users.noreply.github.com> Date: Wed, 18 Jun 2025 02:27:05 +0000 (+0200) Subject: url: fix NULL deref with bad password when no user is provided X-Git-Tag: curl-8_15_0~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9548bf20e8df812ac9a21c86c42da3ba4c97783;p=thirdparty%2Fcurl.git url: fix NULL deref with bad password when no user is provided Closes #17659 --- diff --git a/lib/url.c b/lib/url.c index b7e58e1004..00b8a2b086 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2762,11 +2762,13 @@ static CURLcode parse_remote_port(struct Curl_easy *data, static bool str_has_ctrl(const char *input) { - const unsigned char *str = (const unsigned char *)input; - while(*str) { - if(*str < 0x20) - return TRUE; - str++; + if(input) { + const unsigned char *str = (const unsigned char *)input; + while(*str) { + if(*str < 0x20) + return TRUE; + str++; + } } return FALSE; }