← Commit list

9f18cb6544

Viktor Szakats
Viktor Szakats
2025-09-18
FAILED Duration: 207s

Subject

libssh2: error check and null-terminate in ssh_state_sftp_readdir_link()

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/vssh/libssh2.c+6 -0
@@ -2405,6 +2405,12 @@ static CURLcode ssh_state_sftp_readdir_link(struct Curl_easy *data,
curlx_dyn_free(&sshp->readdir_link);
+ if(rc < 0)
+ return CURLE_OUT_OF_MEMORY;
+
+ /* It seems that this string is not always null-terminated */
+ sshp->readdir_filename[rc] = '\0';
+
/* append filename and extra output */
result = curlx_dyn_addf(&sshp->readdir, " -> %s", sshp->readdir_filename);
if(result)