diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 73d48077b5..69284407ab 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -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)