← Commit list

753735af87

Daniel Stenberg
Daniel Stenberg
2026-09-14
SUCCESS Duration: 406s

Subject

pingpong: add a max loop counter for Curl_pp_readresp

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/pingpong.c+4 -0
@@ -245,6 +245,7 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data,
CURLcode result = CURLE_OK;
size_t gotbytes;
char buffer[900];
+ int maxloops = 10;
*code = 0; /* 0 for errors or not done */
*size = 0;
@@ -262,6 +263,9 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data,
pp->nfinal = 0; /* now gone */
}
if(!pp->overflow) {
+ if(!maxloops--) /* don't get stuck */
+ return CURLE_OK;
+
result = pingpong_read(data, sockindex, buffer, sizeof(buffer),
&gotbytes);
if(result == CURLE_AGAIN)