libssh2: clarify that sshp->path is always at least one byte

Reported-by: Joshua Rogers
Closes #18864
This commit is contained in:
Daniel Stenberg 2025-10-06 09:38:30 +02:00
parent c3adf63ee7
commit d4c0332677
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 2 additions and 1 deletions

View file

@ -100,6 +100,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data,
}
else
*path = working_path;
DEBUGASSERT(*path && (*path)[0]);
return CURLE_OK;
}

View file

@ -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;