url: fix NULL deref with bad password when no user is provided

Closes #17659
This commit is contained in:
z2_ 2025-06-18 04:27:05 +02:00 committed by Daniel Stenberg
parent aaebb45f58
commit f9548bf20e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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;
}