]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Added a temporary hack to avoid coredumps when invalid hdr entry gets
authorrousskov <>
Wed, 1 Apr 1998 00:52:08 +0000 (00:52 +0000)
committerrousskov <>
Wed, 1 Apr 1998 00:52:08 +0000 (00:52 +0000)
destroyed.

src/HttpHeader.cc

index 8ec8d4422bc1692bed45a8e5726292f15c4f33dc..365f6d0468d8fa49994d8e24f989c6de816360f5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.cc,v 1.27 1998/03/31 09:03:45 rousskov Exp $
+ * $Id: HttpHeader.cc,v 1.28 1998/03/31 17:52:08 rousskov Exp $
  *
  * DEBUG: section 55    HTTP Header
  * AUTHOR: Alex Rousskov
@@ -267,6 +267,12 @@ httpHeaderClean(HttpHeader * hdr)
     while ((e = httpHeaderGetEntry(hdr, &pos))) {
        /* fix this for req headers @?@ */
        statHistCount(&HttpHeaderStats[0].fieldTypeDistr, e->id);
+       /* tmp hack to avoid coredumps */
+       if (e->id < 0 || e->id >= HDR_ENUM_END)
+           debug(55, 0) ("httpHeaderClean BUG: entry[%d] is invalid (%d). Ignored.\n",
+               pos, e->id);
+       else
+       /* end of hack */
        /* yes, this destroy() leaves us in an incosistent state */
        httpHeaderEntryDestroy(e);
     }