aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-12-27 22:58:03 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-12-31 23:52:15 +0100
commitc9a3cab6c4250ea6d4872affc6ff0ad6894a8e8c (patch)
treea9e91e84cf6b887b7fe5850fab0db2e50130199b
parentf4949e56ebe99cdd6f7c1798f5685acc7d98aa47 (diff)
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
-rw-r--r--lib/ssh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 23ba5f4e0..e92916e9d 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1885,9 +1885,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
Curl_safefree(sshc->readdir_linkPath);
sshc->readdir_linkPath = NULL;
- new_readdir_line = realloc(sshc->readdir_line,
- sshc->readdir_totalLen + 4 +
- sshc->readdir_len);
+ /* get room for the filename and extra output */
+ sshc->readdir_totalLen += 4 + sshc->readdir_len:
+ new_readdir_line = realloc(sshc->readdir_line, sshc->readdir_totalLen);
if(!new_readdir_line) {
Curl_safefree(sshc->readdir_line);
sshc->readdir_line = NULL;