]> git.ipfire.org Git - thirdparty/nftables.git/commit
parser_bison: fix ct scope underflow if ct helper section is duplicated
authorFlorian Westphal <fw@strlen.de>
Tue, 12 Dec 2023 09:22:58 +0000 (10:22 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 12 Dec 2023 15:33:48 +0000 (16:33 +0100)
commit037d58a27d675802286aafb23e409b8c1d3eef56
tree8212aabbc7258e5647a96caf82b0b7984c3d22fa
parentd5a06af393eaf47571c884a265d1f6e6ba34ed97
parser_bison: fix ct scope underflow if ct helper section is duplicated

table inet filter {
ct helper sip-5060u {
type "sip" protocol udp
l3proto ip
}5060t {
type "sip" protocol tcp
l3pownerip
}

Will close the 'ct' scope twice, it has to be closed AFTER the separator
has been parsed.

While not strictly needed, also error out if the protocol is already
given, this provides a better error description.

Also make sure we release the string in all error branches.

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