]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sendf: fix uninitialized variable in trace output
authorDaniel Stenberg <daniel@haxx.se>
Tue, 25 Nov 2025 07:53:59 +0000 (08:53 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Nov 2025 08:15:04 +0000 (09:15 +0100)
Initialize *nread early on.

Pointed out by CodeSonar

Closes #19684

lib/sendf.c

index f70abb5797bc5b340fc26846648d7b7f95b64bff..4eabc14402da584125a24b958f6e79a1ec9ccdd8 100644 (file)
@@ -1195,6 +1195,7 @@ CURLcode Curl_client_read(struct Curl_easy *data, char *buf, size_t blen,
   DEBUGASSERT(blen);
   DEBUGASSERT(nread);
   DEBUGASSERT(eos);
+  *nread = 0;
 
   if(!data->req.reader_stack) {
     result = Curl_creader_set_fread(data, data->state.infilesize);