]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink_delinarize: don't check for set element if set is not populated
authorFlorian Westphal <fw@strlen.de>
Wed, 30 Jun 2021 15:45:18 +0000 (17:45 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 30 Jun 2021 15:56:16 +0000 (17:56 +0200)
commit6d225d296ec48adefdbd3d003598a5d3c4ee22ff
tree386ed40a964e33ed4d8b78090c45982dcef4e821
parent5fff08b0c940cdd1194b40c602980e73688f7be6
netlink_delinarize: don't check for set element if set is not populated

0065_icmp_postprocessing: line 13: Segmentation fault $NFT insert rule ip x foo index 1 accept

Since no listing is done, cache isn't populated and 'nft insert' will trip over
set->init == NULL during postprocessing of the existing 'icmp id 42' expression.

Fixes: 9a5574e2d4e9 ("netlink_delinearize: add missing icmp id/sequence support")
Reported-by: Eric Garver <eric@garver.life>
Reported-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/netlink_delinearize.c
tests/shell/testcases/sets/0065_icmp_postprocessing [new file with mode: 0755]