From 5f3413929a649d4aeb745b278cf965c347daa417 Mon Sep 17 00:00:00 2001 From: hno <> Date: Wed, 24 Oct 2001 14:52:37 +0000 Subject: [PATCH] Be both stricter and more relaxed when reading TLV records * VOID is reserved * allow for some new types without choking (10) --- src/store_swapmeta.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.47.3