]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh2: clarify that sshp->path is always at least one byte
authorDaniel Stenberg <daniel@haxx.se>
Mon, 6 Oct 2025 07:38:30 +0000 (09:38 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 6 Oct 2025 11:57:19 +0000 (13:57 +0200)
Reported-by: Joshua Rogers
Closes #18864

lib/vssh/curl_path.c
lib/vssh/ssh.h

index 021e85faf8e7c7cce981251b0590c15ff8e1bb62..7a0e5bffef20512aa9e88e9d6219b49ccfd2dc01 100644 (file)
@@ -100,6 +100,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data,
   }
   else
     *path = working_path;
+  DEBUGASSERT(*path && (*path)[0]);
 
   return CURLE_OK;
 }
index 9a5f1b7e318709253275c03949d329590dde8fce..e09111e63f6637aed0842379dd5332931845dbce 100644 (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;