evaluate: missing location for chain nested in table definition
Pablo Neira Ayuso
maintainerPATCH 1/1 evaluate: missing location for chain nested in table definition
error reporting may crash because location is unset.
Signed-off-by Pablo Neira Ayuso <[email protected]>
---
This supersedes your patch 2/3. Regarding 1/3, I think it should be good to assume location must be always set, so BUG() is probably a good idea from erec_print() if unset.
src/evaluate.c | 1 + 1 file changed, 1 insertion(+)
src/evaluate.c +1 -0
@@ -3516,6 +3516,7 @@ static int table_evaluate(struct eval_ctx *ctx, struct table *table) }list_for_each_entry (chain, &table->chains, list) {handle_merge (&chain->handle, &table->handle); + ctx->cmd->handle.chain.location = chain->location;if (chain_evaluate (ctx, chain) <0 )return -1 ; }
Signature · 1 line
2.11.0
Florian Westphal
maintainerQuoted 7 lines · Pablo Neira Ayuso
error reporting may crash because location is unset.
Signed-off-by Pablo Neira Ayuso <[email protected]>---
This supersedes your patch 2/3. Regarding 1/3, I think it should be good to assume location must be always set, soBUG()is probably a good idea fromerec_print()if unset.
I can confirm this works, instead of crash one now gets crash.nft:7:13-16: Error: No such file or directory
chain test {
^^^^