From: serassio <> Date: Thu, 15 Jun 2006 01:39:19 +0000 (+0000) Subject: Bug #1587: assertion failed on invalid reply X-Git-Tag: SQUID_3_0_PRE4~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42f79b17d2e7737c31e26f05231f7549b4d2295d;p=thirdparty%2Fsquid.git Bug #1587: assertion failed on invalid reply Patch provided by Gonzalo Arana. --- diff --git a/src/http.cc b/src/http.cc index f5567e2e34..a1cd3d831c 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.502 2006/06/13 18:36:52 hno Exp $ + * $Id: http.cc,v 1.503 2006/06/14 19:39:19 serassio Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1065,10 +1065,15 @@ HttpStateData::readReply (size_t len, comm_err_t flag, int xerrno) processReplyHeader(); if (flags.headers_parsed) { - http_status s = getReply()->sline.status; - HttpVersion httpver = getReply()->sline.version; + bool fail = reply == NULL; - if (s == HTTP_INVALID_HEADER && httpver != HttpVersion(0,9)) { + if (!fail) { + http_status s = getReply()->sline.status; + HttpVersion httpver = getReply()->sline.version; + fail = s == HTTP_INVALID_HEADER && httpver != HttpVersion(0,9); + } + + if (fail) { storeEntryReset(entry); fwd->fail( errorCon(ERR_INVALID_RESP, HTTP_BAD_GATEWAY)); comm_close(fd);