← Commit list

d888a53e14

Daniel Stenberg
Daniel Stenberg
2026-04-02
SUCCESS Duration: 285s

Subject

libssh: path length precaution

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/libssh.c+3 -1
@@ -2029,7 +2029,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
if(data->state.upload)
myssh_to(data, sshc, SSH_SFTP_UPLOAD_INIT);
else if(sshp) {
- if(sshp->path[strlen(sshp->path) - 1] == '/')
+ size_t path_len = strlen(sshp->path);
+
+ if(path_len && sshp->path[path_len - 1] == '/')
myssh_to(data, sshc, SSH_SFTP_READDIR_INIT);
else
myssh_to(data, sshc, SSH_SFTP_DOWNLOAD_INIT);