← Commit list

41931f1659

Daniel Stenberg
Daniel Stenberg
2025-12-01
SUCCESS Duration: 158s

Subject

imap: make sure Curl_pgrsSetDownloadSize() does not overflow

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/imap.c+3 -2
@@ -1214,8 +1214,6 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data,
/* This is a literal response, setup to receive the body data */
infof(data, "Found %" FMT_OFF_T " bytes to download", size);
- /* Progress size includes both header line and literal body */
- Curl_pgrsSetDownloadSize(data, size + len);
/* First write the header line */
result = Curl_client_write(data, CLIENTWRITE_BODY, line, len);
@@ -1268,6 +1266,9 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data,
else
size += len;
+ /* Progress size includes both header line and literal body */
+ Curl_pgrsSetDownloadSize(data, size);
+
if(data->req.bytecount == size)
/* All data already transferred (header + literal body) */
Curl_xfer_setup_nop(data);