summaryrefslogtreecommitdiffstats
path: root/include/netlink.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-06-10 17:19:49 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-06-10 17:35:13 +0200
commit371c3a0bc3c2bf027127b27a15419d1e18a530d6 (patch)
treec86ef3d0a897e40e56393563c43f3afe92c0cee6 /include/netlink.h
parentaaf0167f2615372c1baaff327d1fb89d4297a52a (diff)
netlink_delinearize: release expressions in context registers
netlink_release_registers() needs to go a bit further to release the expressions in the register array. This should be safe since netlink_get_register() clones expressions in the context registers. Reported-by: Václav Zindulka <vaclav.zindulka@tlapnet.cz> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/netlink.h')
-rw-r--r--include/netlink.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/netlink.h b/include/netlink.h
index a20ebbe4..0c08b1ab 100644
--- a/include/netlink.h
+++ b/include/netlink.h
@@ -14,12 +14,14 @@
#include <rule.h>
+#define MAX_REGS (1 + NFT_REG32_15 - NFT_REG32_00)
+
struct netlink_parse_ctx {
struct list_head *msgs;
struct table *table;
struct rule *rule;
struct stmt *stmt;
- struct expr *registers[1 + NFT_REG32_15 - NFT_REG32_00 + 1];
+ struct expr *registers[MAX_REGS + 1];
unsigned int debug_mask;
};