From: Daniel Stenberg Date: Tue, 31 Oct 2023 15:22:07 +0000 (+0100) Subject: urlapi: skip appending NULL pointer query X-Git-Tag: curl-8_5_0~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffbc9981c428ca493a0641cb414618d4ef46e9c0;p=thirdparty%2Fcurl.git urlapi: skip appending NULL pointer query Reported-by: kirbyn17 on hackerone Closes #12240 --- diff --git a/lib/urlapi.c b/lib/urlapi.c index be27b02332..329f80393b 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -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 */