]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: fix assertion failure with malformed map definitions
authorFlorian Westphal <fw@strlen.de>
Thu, 20 Mar 2025 13:33:05 +0000 (14:33 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 20 Mar 2025 18:59:42 +0000 (19:59 +0100)
commit7fa22984d7841a0feeaaeb0c2ed5d3cb637097e0
treea2ca2e3d121aa188bd759ef05a7d9c4c9f5041a6
parent853d3a2d3cbdc7aab16d3d33999d00b32a6db7ce
evaluate: fix assertion failure with malformed map definitions

Included bogon triggers:
nft: src/evaluate.c:2267: expr_evaluate_mapping: Assertion `set->data != NULL' failed.

After this fix, following errors will be shown:
Error: unqualified type invalid specified in map definition. Try "typeof expression" instead of "type datatype".
map m {
    ^
map m {
    ^
Error: map has no mapping data

Fixes: 343a51702656 ("src: store expr, not dtype to track data in sets")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
tests/shell/testcases/bogons/nft-f/malformed_map_expr_evaluate_mapping_assert [new file with mode: 0644]