From ffbc9981c428ca493a0641cb414618d4ef46e9c0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 31 Oct 2023 16:22:07 +0100 Subject: [PATCH] urlapi: skip appending NULL pointer query Reported-by: kirbyn17 on hackerone Closes #12240 --- lib/urlapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */