Projects
Mega:23.03
curl
_service:tar_scm:backport-CVE-2023-27534-pre1.p...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-CVE-2023-27534-pre1.patch of Package curl
From 6c51adeb71da076c5c40a45e339e06bb4394a86b Mon Sep 17 00:00:00 2001 From: Eric Vigeant <evigeant@gmail.com> Date: Wed, 2 Nov 2022 11:47:09 -0400 Subject: [PATCH] cur_path: do not add '/' if homedir ends with one When using SFTP and a path relative to the user home, do not add a trailing '/' to the user home dir if it already ends with one. Closes #9844 --- lib/curl_path.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/curl_path.c b/lib/curl_path.c index 27ff96d1fc558..f00e3ee74dceb 100644 --- a/lib/curl_path.c +++ b/lib/curl_path.c @@ -71,10 +71,14 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, /* It is referenced to the home directory, so strip the leading '/' */ memcpy(real_path, homedir, homelen); - real_path[homelen] = '/'; - real_path[homelen + 1] = '\0'; + /* Only add a trailing '/' if homedir does not end with one */ + if(homelen == 0 || real_path[homelen - 1] != '/') { + real_path[homelen] = '/'; + homelen++; + real_path[homelen] = '\0'; + } if(working_path_len > 3) { - memcpy(real_path + homelen + 1, working_path + 3, + memcpy(real_path + homelen, working_path + 3, 1 + working_path_len -3); } }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2