From 62c50b8a4ada5ad54094b1806c773a010eac8b52 Mon Sep 17 00:00:00 2001 From: Carlos Henrique Lima Melara Date: Thu, 5 Jun 2025 14:29:06 +0200 Subject: [PATCH] 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 --- lib/curl_path.c | 6 ++++++ 1 file changed, 6 insertions(+) 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)) { -- 2.30.2