]> git.ipfire.org Git - thirdparty/nftables.git/commit
rule: return error if table does not exist
authorFlorian Westphal <fw@strlen.de>
Thu, 20 Mar 2025 13:31:42 +0000 (14:31 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 20 Mar 2025 17:42:41 +0000 (18:42 +0100)
commit853d3a2d3cbdc7aab16d3d33999d00b32a6db7ce
tree13ed2bd2098f47368f01ceeba909418bfa8b8b20
parent43cf4a2973ee9e3ab20edce47c6a054485707592
rule: return error if table does not exist

The bogon triggers segfault due to NULL dereference.  Error out and set
errno to ENOENT; caller uses strerror() in the errmsg.

After fix, loading reproducer results in:
/tmp/A:2:1-18: Error: Could not process rule: No such file or directory
list table inet p
^^^^^^^^^^^^^^^^^^

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c
tests/shell/testcases/bogons/nft-f/list_a_deleted_table_crash [new file with mode: 0644]