← Commit list

77ee52333

Paul Fox
Paul Fox
2005-07-20
FAILED Duration: 22s

Subject

applying fix for: 0000185: httpd infinite loop when piping to CGI script

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 →

networking/httpd.c+3 -1
@@ -1259,6 +1259,8 @@ static int sendCgi(const char *url,
post_readed_idx += count;
if(post_readed_size == 0)
post_readed_idx = 0;
+ } else {
+ post_readed_size = post_readed_idx = bodyLen = 0; /* broken pipe to CGI */
}
} else if(bodyLen > 0 && post_readed_size == 0 && FD_ISSET(a_c_r, &readSet)) {
count = bodyLen > sizeof(wbuf) ? sizeof(wbuf) : bodyLen;
@@ -1266,7 +1268,7 @@ static int sendCgi(const char *url,
if(count > 0) {
post_readed_size += count;
bodyLen -= count;
- } else {
+ } else {
bodyLen = 0; /* closed */
}
}