]> granicus.if.org Git - curl/commitdiff
libssh: fixed dereference in statvfs access
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 4 Dec 2017 08:24:06 +0000 (09:24 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 4 Dec 2017 08:24:45 +0000 (09:24 +0100)
The behavior is now equivalent to ssh.c when SSH_SFTP_QUOTE_STATVFS
handling fails.

Fixes #2142

lib/ssh-libssh.c

index 1277324bfa3e30bbc92bc53845cc3b7f3484bb5a..23f28dca440b62cefa88d479085b9840a60b2f2f 100644 (file)
@@ -998,7 +998,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
         sshc->actualcode = CURLE_QUOTE_ERROR;
         break;
       }
-      else {
+      else if (statvfs) {
         char *tmp = aprintf("statvfs:\n"
                             "f_bsize: %llu\n" "f_frsize: %llu\n"
                             "f_blocks: %llu\n" "f_bfree: %llu\n"