]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1587: assertion failed on invalid reply
authorserassio <>
Thu, 15 Jun 2006 01:39:19 +0000 (01:39 +0000)
committerserassio <>
Thu, 15 Jun 2006 01:39:19 +0000 (01:39 +0000)
Patch provided by Gonzalo Arana.

src/http.cc

index f5567e2e34cb15821fb59f19e749708d2d8c7b06..a1cd3d831ce73ebcec085f9d0a5231e355938928 100644 (file)
@@ -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);