]> git.ipfire.org Git - thirdparty/nftables.git/commit
parser: don't assert on scope underflows
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Jun 2023 20:43:03 +0000 (22:43 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 20 Jun 2023 19:44:52 +0000 (21:44 +0200)
commitbb16416ec82599e41043a52887c37157e6f61984
treec3e4f05777ef2cd8f6719f703a7dadf13ed232ca
parent75217cb7bb78e22fc9317116353149def8a306e9
parser: don't assert on scope underflows

close_scope() gets called from the object destructors;
imbalance can cause us to hit assert().

Before:
nft: parser_bison.y:88: close_scope: Assertion `state->scope > 0' failed.
After:
assertion3:4:7-7: Error: too many levels of nesting jump {
assertion3:5:8-8: Error: too many levels of nesting jump
assertion3:5:9-9: Error: syntax error, unexpected newline, expecting '{'
assertion3:7:1-1: Error: syntax error, unexpected end of file

Signed-off-by: Florian Westphal <fw@strlen.de>
src/parser_bison.y
tests/shell/testcases/bogons/nft-f/scope_underflow_assert [new file with mode: 0644]