From 4109848cdf4c31d8ea1a410b183478ad4124f15b Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 21 Jan 2016 20:01:54 -0600 Subject: [PATCH] registry: define MAX_VALUE_SIZE with other limits --- src/registry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/registry.c b/src/registry.c index 6b7f9815..36ecdd39 100644 --- a/src/registry.c +++ b/src/registry.c @@ -143,6 +143,7 @@ struct data_cell { /* Arbitrary limits for safety */ #define MAX_VALUES 65536 +#define MAX_VALUE_SIZE 1048576 #define MAX_SUBKEYS 65536 #define MAX_SUBKEY_LIST_LEVELS 5 #define MAX_SUBKEY_LISTS 4096 @@ -532,7 +533,7 @@ retrieve_value(const struct regf *regf, const tchar *key_name, is_inline = (data_size & 0x80000000); data_size &= 0x7FFFFFFF; - if (data_size > 1048576) /* Arbitrary limit */ + if (data_size > MAX_VALUE_SIZE) return HIVE_CORRUPT; if (is_inline) { -- 2.43.0