]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: fix NULL deref with bad password when no user is provided
authorz2_ <88509734+z2-2z@users.noreply.github.com>
Wed, 18 Jun 2025 02:27:05 +0000 (04:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 20 Jun 2025 21:13:49 +0000 (23:13 +0200)
Closes #17659

lib/url.c

index b7e58e1004f62c3f7619e67fe1c6d42e79544133..00b8a2b086b0097c29ed8b7510667582b3c1b500 100644 (file)
--- 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;
 }