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 <[email protected]>
---
 src/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/object.c b/src/object.c
index e88203a82441e..5c8d1835ca97e 100644
--- a/src/object.c
+++ b/src/object.c
@@ -25,7 +25,7 @@
 #include <buffer.h>
 #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,
-- 
2.19.0

Reply via email to