* [PATCH nft] parser_json: fix crash on add rule to bad references
@ 2019-05-01 16:34 Eric Garver
2019-05-03 15:43 ` Phil Sutter
2019-05-03 16:15 ` Pablo Neira Ayuso
0 siblings, 2 replies; 3+ messages in thread
From: Eric Garver @ 2019-05-01 16:34 UTC (permalink / raw)
To: netfilter-devel; +Cc: Phil Sutter
Pass the location via the handle so the error leg in
rule_translate_index() can reference it. Applies to invalid references
to tables, chains, and indexes.
Fixes: 586ad210368b ("libnftables: Implement JSON parser")
Signed-off-by: Eric Garver <eric@garver.life>
---
src/parser_json.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/parser_json.c b/src/parser_json.c
index 10ce259f0241..3fbb4457ddac 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -2429,7 +2429,11 @@ static struct cmd *json_parse_cmd_add_chain(struct json_ctx *ctx, json_t *root,
static struct cmd *json_parse_cmd_add_rule(struct json_ctx *ctx, json_t *root,
enum cmd_ops op, enum cmd_obj obj)
{
- struct handle h = { 0 };
+ struct handle h = {
+ .table.location = *int_loc,
+ .chain.location = *int_loc,
+ .index.location = *int_loc,
+ };
const char *family = "", *comment = NULL;
struct rule *rule;
size_t index;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nft] parser_json: fix crash on add rule to bad references
2019-05-01 16:34 [PATCH nft] parser_json: fix crash on add rule to bad references Eric Garver
@ 2019-05-03 15:43 ` Phil Sutter
2019-05-03 16:15 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Phil Sutter @ 2019-05-03 15:43 UTC (permalink / raw)
To: Eric Garver; +Cc: netfilter-devel
On Wed, May 01, 2019 at 12:34:45PM -0400, Eric Garver wrote:
> Pass the location via the handle so the error leg in
> rule_translate_index() can reference it. Applies to invalid references
> to tables, chains, and indexes.
>
> Fixes: 586ad210368b ("libnftables: Implement JSON parser")
> Signed-off-by: Eric Garver <eric@garver.life>
Acked-by: Phil Sutter <phil@nwl.cc>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nft] parser_json: fix crash on add rule to bad references
2019-05-01 16:34 [PATCH nft] parser_json: fix crash on add rule to bad references Eric Garver
2019-05-03 15:43 ` Phil Sutter
@ 2019-05-03 16:15 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2019-05-03 16:15 UTC (permalink / raw)
To: Eric Garver; +Cc: netfilter-devel, Phil Sutter
On Wed, May 01, 2019 at 12:34:45PM -0400, Eric Garver wrote:
> Pass the location via the handle so the error leg in
> rule_translate_index() can reference it. Applies to invalid references
> to tables, chains, and indexes.
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-03 16:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 16:34 [PATCH nft] parser_json: fix crash on add rule to bad references Eric Garver
2019-05-03 15:43 ` Phil Sutter
2019-05-03 16:15 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.