From 16c44d9f42170264c4d484478c76e940951f1b70 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 20 Dec 2018 21:03:27 +0100 Subject: object: Avoid obj_ops array overrun In version 1.1.1, obj_ops array was smaller than __NFT_OBJECT_MAX since there are no ops for NFT_OBJECT_CONNLIMIT. Avoid this potential issue in the future by defining the array size. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object.c') diff --git a/src/object.c b/src/object.c index e88203a..5c8d183 100644 --- a/src/object.c +++ b/src/object.c @@ -25,7 +25,7 @@ #include #include "obj.h" -static struct obj_ops *obj_ops[] = { +static struct obj_ops *obj_ops[__NFT_OBJECT_MAX] = { [NFT_OBJECT_COUNTER] = &obj_ops_counter, [NFT_OBJECT_QUOTA] = &obj_ops_quota, [NFT_OBJECT_CT_HELPER] = &obj_ops_ct_helper, -- cgit v1.2.3