From: rousskov <> Date: Wed, 1 Apr 1998 00:52:08 +0000 (+0000) Subject: - Added a temporary hack to avoid coredumps when invalid hdr entry gets X-Git-Tag: SQUID_3_0_PRE1~3676 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b48976a5283870445771c555075898d6506845d;p=thirdparty%2Fsquid.git - Added a temporary hack to avoid coredumps when invalid hdr entry gets destroyed. --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 8ec8d4422b..365f6d0468 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -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); }