]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Be both stricter and more relaxed when reading TLV records
authorhno <>
Wed, 24 Oct 2001 14:52:37 +0000 (14:52 +0000)
committerhno <>
Wed, 24 Oct 2001 14:52:37 +0000 (14:52 +0000)
 * VOID is reserved
 * allow for some new types without choking (10)

src/store_swapmeta.cc

index 25ce0df992fc8f03e26fe1af283701a12983cbf9..5a22c79641b8be5388a023aa503be4981c5fa200 100644 (file)
@@ -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;
        }