From 025bad1182ff87facbddd280dd07a0fc26b99f45 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 16 Oct 2022 18:09:14 +0200 Subject: [PATCH] curl_path: return error if given a NULL homedir Closes #9740 --- lib/curl_path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/curl_path.c b/lib/curl_path.c index 259837539d..b55e83047d 100644 --- a/lib/curl_path.c +++ b/lib/curl_path.c @@ -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;