1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

SFTP dir: increase buffer size counter

When the buffer gets realloced to hold the file name in the
SSH_SFTP_READDIR_LINK state, the counter was not bumped accordingly.

Reported by: Armel Asselin
Patch by: Armel Asselin
Bug: http://curl.haxx.se/mail/lib-2011-12/0249.html
This commit is contained in:
Daniel Stenberg 2011-12-27 22:58:03 +01:00
parent f4949e56eb
commit c9a3cab6c4

View File

@ -1885,9 +1885,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
Curl_safefree(sshc->readdir_linkPath); Curl_safefree(sshc->readdir_linkPath);
sshc->readdir_linkPath = NULL; sshc->readdir_linkPath = NULL;
new_readdir_line = realloc(sshc->readdir_line, /* get room for the filename and extra output */
sshc->readdir_totalLen + 4 + sshc->readdir_totalLen += 4 + sshc->readdir_len:
sshc->readdir_len); new_readdir_line = realloc(sshc->readdir_line, sshc->readdir_totalLen);
if(!new_readdir_line) { if(!new_readdir_line) {
Curl_safefree(sshc->readdir_line); Curl_safefree(sshc->readdir_line);
sshc->readdir_line = NULL; sshc->readdir_line = NULL;