]> 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>
Thu, 9 Nov 2023 16:25:48 +0000 (17:25 +0100)
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 120a8ba9ceb1e14a2b171db854141f0a4632f048..4b9722f9e4954b76ab972dbc988841b4e3f7659f 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;