[PATCH nft] evaluate: missing location for chain nested in table definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



error reporting may crash because location is unset.

Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
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(+)

diff --git a/src/evaluate.c b/src/evaluate.c
index 69b853f58722..c6cc6ccad75d 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -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;
 	}
-- 
2.11.0





[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux