]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_path: return error if given a NULL homedir
authorDaniel Stenberg <daniel@haxx.se>
Sun, 16 Oct 2022 16:09:14 +0000 (18:09 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 16 Oct 2022 21:49:23 +0000 (23:49 +0200)
Closes #9740

lib/curl_path.c

index 259837539d25e745a7845d2fbecc94f685cceb84..b55e83047dd5dd4a5eaa9913833ae53acf463101 100644 (file)
@@ -122,7 +122,8 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, char *homedir)
   bool relativePath = false;
   static const char WHITESPACE[] = " \t\r\n";
 
-  if(!*cp) {
+  DEBUGASSERT(homedir);
+  if(!*cp || !homedir) {
     *cpp = NULL;
     *path = NULL;
     return CURLE_QUOTE_ERROR;