From: Carlos Henrique Lima Melara Date: Thu, 5 Jun 2025 12:29:06 +0000 (+0200) Subject: curl_path: make SFTP handle a path like /~ properly. X-Git-Tag: archive/raspbian/7.88.1-10+rpi1+deb12u14^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=62c50b8a4ada5ad54094b1806c773a010eac8b52;p=curl.git curl_path: make SFTP handle a path like /~ properly. ... without a trailing slash. Fixes #17534 Closes #17542 Origin: upstream, https://github.com/curl/curl/commit/0ede81dcc61844cecce8904fb4de24319afeb024 Bug: https://github.com/curl/curl/issues/17534 Last-Update: 2025-06-09 Gbp-Pq: Name fix-CVE-2023-27534-regression-2.patch --- diff --git a/lib/curl_path.c b/lib/curl_path.c index b4b48fe8..db66fb02 100644 --- a/lib/curl_path.c +++ b/lib/curl_path.c @@ -84,6 +84,12 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; } } + else { + if(Curl_dyn_add(&npath, "/")) { + free(working_path); + return CURLE_OUT_OF_MEMORY; + } + } } if(Curl_dyn_len(&npath)) {