]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh2: avoid risking using an uninitialized local struct field
authorDaniel Stenberg <daniel@haxx.se>
Mon, 13 Oct 2025 07:40:38 +0000 (09:40 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 13 Oct 2025 10:29:13 +0000 (12:29 +0200)
Reported-by: Joshua Rogers
Closes #19043

lib/vssh/libssh2.c

index dfdb8526d610a5ccd47707329c79b847b35321b0..ee468bb35958429c1de3e63e877d5c4dba57bc7e 100644 (file)
@@ -1428,6 +1428,7 @@ sftp_download_stat(struct Curl_easy *data,
     data->req.size = -1;
     data->req.maxdownload = -1;
     Curl_pgrsSetDownloadSize(data, -1);
+    attrs.filesize = 0; /* might be uninitialized but will be read below */
   }
   else {
     curl_off_t size = attrs.filesize;