From d4c033267740d8b2e65520c89f2c5b4e5a5ee174 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 6 Oct 2025 09:38:30 +0200 Subject: [PATCH] libssh2: clarify that sshp->path is always at least one byte Reported-by: Joshua Rogers Closes #18864 --- lib/vssh/curl_path.c | 1 + lib/vssh/ssh.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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; -- 2.47.3