From: serassio <> Date: Mon, 7 Mar 2005 02:37:17 +0000 (+0000) Subject: Bug #1233: Data corruption under certain conditions involving X-Git-Tag: SQUID_3_0_PRE4~861 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdec836014f32b44b3bc22e6cf16167a8fa4d6c8;p=thirdparty%2Fsquid.git Bug #1233: Data corruption under certain conditions involving http headers split over multiple packets. Forward port of 2.5 patch. --- diff --git a/src/http.cc b/src/http.cc index 1478fd2099..826adbdceb 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.445 2005/03/06 14:46:29 serassio Exp $ + * $Id: http.cc,v 1.446 2005/03/06 19:37:17 serassio Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -638,7 +638,7 @@ void HttpStateData::processReplyHeader(const char *buf, int size) { size_t hdr_len; - size_t hdr_size = headersEnd(buf, size); + size_t hdr_size; /* Creates a blank header. If this routine is made incremental, this will * not do */ @@ -652,10 +652,7 @@ HttpStateData::processReplyHeader(const char *buf, int size) assert(reply_hdr_state == 0); - if (hdr_size) - memBufAppend(&reply_hdr, buf, hdr_size); - else - memBufAppend(&reply_hdr, buf, size); + memBufAppend(&reply_hdr, buf, size); hdr_len = reply_hdr.size; @@ -668,8 +665,7 @@ HttpStateData::processReplyHeader(const char *buf, int size) return; } - if (hdr_size != hdr_len) - hdr_size = headersEnd(reply_hdr.buf, hdr_len); + hdr_size = headersEnd(reply_hdr.buf, hdr_len); if (hdr_size) hdr_len = hdr_size;