From: Daniel Stenberg Date: Sat, 13 Aug 2005 21:28:46 +0000 (+0000) Subject: James Bursa identified a libcurl HTTP bug and a good way to repeat it. If a X-Git-Tag: curl-7_14_1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35110eca737b86c555add7d3fd19dc4111ed8248;p=thirdparty%2Fcurl.git James Bursa identified a libcurl HTTP bug and a good way to repeat it. If a site responds with bad HTTP response that doesn't contain any header at all, only a response body, and the write callback returns 0 to abort the transfer, it didn't have any real effect but the write callback would be called once more anyway. --- diff --git a/lib/transfer.c b/lib/transfer.c index a2cd391793..544ac8560a 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1134,6 +1134,8 @@ CURLcode Curl_readwrite(struct connectdata *conn, result = Curl_client_write(data, CLIENTWRITE_BODY, data->state.headerbuff, k->hbuflen); + if(result) + return result; } if(k->badheader < HEADER_ALLBAD) { /* This switch handles various content encodings. If there's an