libssh2: avoid risking using an uninitialized local struct field

Reported-by: Joshua Rogers
Closes #19043
This commit is contained in:
Daniel Stenberg 2025-10-13 09:40:38 +02:00
parent 6d0fcdf2ed
commit f1828b5404
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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;