]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urlapi: skip appending NULL pointer query
authorDaniel Stenberg <daniel@haxx.se>
Tue, 31 Oct 2023 15:22:07 +0000 (16:22 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 1 Nov 2023 09:55:55 +0000 (10:55 +0100)
Reported-by: kirbyn17 on hackerone
Closes #12240

lib/urlapi.c

index be27b02332419cf7e0a1570bf4be5e5635285d61..329f80393b75ea2e79834bd21f8f628ef37dcfd3 100644 (file)
@@ -1902,7 +1902,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
     }
     newp = Curl_dyn_ptr(&enc);
 
-    if(appendquery) {
+    if(appendquery && newp) {
       /* Append the 'newp' string onto the old query. Add a '&' separator if
          none is present at the end of the existing query already */