]> git.ipfire.org Git - thirdparty/nftables.git/commit
parser: prohibit redefinitions of symbols and verify existance on use
authorPatrick McHardy <kaber@trash.net>
Tue, 4 Feb 2014 11:22:31 +0000 (11:22 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 4 Feb 2014 11:26:25 +0000 (11:26 +0000)
commit852cefe60391a16c5fa238f3ab3044dad239c508
tree90b9939c14df1a6f4dde6d55506a5e75414bb1ee
parent47e7132763633d88307ed5fadaf5f2b11d5490c6
parser: prohibit redefinitions of symbols and verify existance on use

This patch fixes some incorrect behaviour of symbolic variables:

- prohibit redefining an existing symbol
- verify existance of a symbolic variable during parsing instead of evaluation

The second point makes sure we don't allow recursive definitions (var = $var),
which lead to a crash due to stack exhaustion.

Signed-off-by: Patrick McHardy <kaber@trash.net>
src/parser.y
tests/symbolic-define.1 [new file with mode: 0644]
tests/symbolic-define.2 [new file with mode: 0644]
tests/symbolic-define.3 [new file with mode: 0644]