]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: fix buffer size for user data in netlink_delinearize_chain()
authorThomas Haller <thaller@redhat.com>
Wed, 8 Nov 2023 18:22:20 +0000 (19:22 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 21 Nov 2023 14:55:56 +0000 (15:55 +0100)
commit 505a6794422238f9f1d590fe8c1ee3ea7fd46579 upstream.

The correct define is NFTNL_UDATA_CHAIN_MAX and not NFTNL_UDATA_OBJ_MAX.
In current libnftnl, they both are defined as 1, so (with current libnftnl)
there is no difference.

Fixes: 702ac2b72c0e ("src: add comment support for chains")
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c

index 8d517c101701329bc48a884eb4f3985ff0a74486..4d7c7458382a6507a851ed32f9cd8019d4c28ac7 100644 (file)
@@ -617,7 +617,7 @@ static int qsort_device_cmp(const void *a, const void *b)
 struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx,
                                        const struct nftnl_chain *nlc)
 {
-       const struct nftnl_udata *ud[NFTNL_UDATA_OBJ_MAX + 1] = {};
+       const struct nftnl_udata *ud[NFTNL_UDATA_CHAIN_MAX + 1] = {};
        int priority, policy, len = 0, i;
        const char * const *dev_array;
        struct chain *chain;