From: Daniel Stenberg Date: Mon, 6 Oct 2025 07:38:30 +0000 (+0200) Subject: libssh2: clarify that sshp->path is always at least one byte X-Git-Tag: rc-8_17_0-2~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4c033267740d8b2e65520c89f2c5b4e5a5ee174;p=thirdparty%2Fcurl.git libssh2: clarify that sshp->path is always at least one byte Reported-by: Joshua Rogers Closes #18864 --- diff --git a/lib/vssh/curl_path.c b/lib/vssh/curl_path.c index 021e85faf8..7a0e5bffef 100644 --- a/lib/vssh/curl_path.c +++ b/lib/vssh/curl_path.c @@ -100,6 +100,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, } else *path = working_path; + DEBUGASSERT(*path && (*path)[0]); return CURLE_OK; } diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 9a5f1b7e31..e09111e63f 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -120,7 +120,7 @@ typedef enum { Everything that is strictly related to a connection is banned from this struct. */ struct SSHPROTO { - char *path; /* the path we operate on */ + char *path; /* the path we operate on, at least one byte long */ #ifdef USE_LIBSSH2 struct dynbuf readdir_link; struct dynbuf readdir;