From 4dedecf4d64ef64f7f86efeeed117be931005282 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 22 Aug 2017 18:09:12 +0200 Subject: src: add maximum number of parser errors to struct nft_ctx Not a global variable anymore. Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 0a56d12c..a187d098 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -692,7 +692,7 @@ input : /* empty */ list_add_tail(&$2->list, &list); if (cmd_evaluate(&state->ectx, $2) < 0) { - if (++state->nerrs == max_errors) + if (++state->nerrs == nft->parser_max_errors) YYABORT; } else list_splice_tail(&list, &state->cmds); @@ -731,7 +731,7 @@ common_block : INCLUDE QUOTED_STRING stmt_seperator } | error stmt_seperator { - if (++state->nerrs == max_errors) + if (++state->nerrs == nft->parser_max_errors) YYABORT; yyerrok; } @@ -758,7 +758,7 @@ line : common_block { $$ = NULL; } list_add_tail(&$1->list, &list); if (cmd_evaluate(&state->ectx, $1) < 0) { - if (++state->nerrs == max_errors) + if (++state->nerrs == nft->parser_max_errors) YYABORT; } else list_splice_tail(&list, &state->cmds); -- cgit v1.2.3