mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:33:33 +03:00
libssh2: drop two redundant null-terminations
The null-termination was first added in the initial SFTP commit in 2006:a634f64400At that time this was a reasonable concern because libssh2 started null-terminating this string just one year prior, in 2005:efc3841fd2This fix was released in libssh2 v0.13 (2006-03-02). curl requires libssh2 v1.2.8, making this workaround no longer necessary. Follow-up to9f18cb6544#18598 Closes #18606
This commit is contained in:
parent
9fb8d567ca
commit
0d9a07abb7
1 changed files with 0 additions and 5 deletions
|
|
@ -1995,8 +1995,6 @@ static CURLcode ssh_state_sftp_realpath(struct Curl_easy *data,
|
|||
return CURLE_AGAIN;
|
||||
|
||||
if(rc > 0) {
|
||||
/* It seems that this string is not always null-terminated */
|
||||
sshp->readdir_filename[rc] = '\0';
|
||||
free(sshc->homedir);
|
||||
sshc->homedir = strdup(sshp->readdir_filename);
|
||||
if(!sshc->homedir) {
|
||||
|
|
@ -2408,9 +2406,6 @@ static CURLcode ssh_state_sftp_readdir_link(struct Curl_easy *data,
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue