From: hno <> Date: Wed, 24 Oct 2001 14:52:37 +0000 (+0000) Subject: Be both stricter and more relaxed when reading TLV records X-Git-Tag: SQUID_3_0_PRE1~1319 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f3413929a649d4aeb745b278cf965c347daa417;p=thirdparty%2Fsquid.git Be both stricter and more relaxed when reading TLV records * VOID is reserved * allow for some new types without choking (10) --- diff --git a/src/store_swapmeta.cc b/src/store_swapmeta.cc index 25ce0df992..5a22c79641 100644 --- a/src/store_swapmeta.cc +++ b/src/store_swapmeta.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.cc,v 1.16 2001/04/14 00:25:19 hno Exp $ + * $Id: store_swapmeta.cc,v 1.17 2001/10/24 08:52:37 hno Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -134,7 +134,8 @@ storeSwapMetaUnpack(const char *buf, int *hdr_len) return NULL; while (buflen - j > (sizeof(char) + sizeof(int))) { type = buf[j++]; - if (type < STORE_META_VOID || type > STORE_META_END) { + /* VOID is reserved, but allow some slack for new types.. */ + if (type <= STORE_META_VOID || type > STORE_META_END + 10) { debug(20, 0) ("storeSwapMetaUnpack: bad type (%d)!\n", type); break; }