]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: prevent null deref if chain->policy is not set
authorFlorian Westphal <fw@strlen.de>
Mon, 2 Jun 2025 12:22:33 +0000 (14:22 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 4 Jun 2025 10:45:14 +0000 (12:45 +0200)
commit69b90023c7220fe283ee38686c758e3494e853d9
tree67c866d72360b2aefa2d22cdee5b9e8455cb0d94
parentc2ee1d5978bf6ea10e3b1a74125da5b5e8468f26
json: prevent null deref if chain->policy is not set

The two commits mentioned below resolved null dererence crashes when the
policy resp. priority keyword was missing in the chain/flowtable
specification.

Same issue exists in the json output path, so apply similar fix there
and extend the existing test cases.

Fixes: 5b37479b42b3 ("nftables: don't crash in 'list ruleset' if policy is not set")
Fixes: b40bebbcee36 ("rule: do not crash if to-be-printed flowtable lacks priority")
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Phil Sutter <phil@nwl.cc>
src/json.c
tests/shell/testcases/bogons/nft-j-f/flowtable-no-priority-crash [new file with mode: 0644]
tests/shell/testcases/nft-f/0021list_ruleset_0