From 6257aaf53ede6456e28b0224d215c811f534ff35 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 12 Aug 2016 01:33:39 +0200 Subject: ruleset: Initialize ctx.flags before calling nftnl_ruleset_ctx_set() The called function otherwise accesses uninitialized data. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/ruleset.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/ruleset.c b/src/ruleset.c index 666bcc7..2f3c110 100644 --- a/src/ruleset.c +++ b/src/ruleset.c @@ -551,6 +551,7 @@ static int nftnl_ruleset_json_parse(const void *json, ctx.cb = cb; ctx.format = type; + ctx.flags = 0; ctx.set_list = nftnl_set_list_alloc(); if (ctx.set_list == NULL) @@ -682,6 +683,7 @@ static int nftnl_ruleset_xml_parse(const void *xml, struct nftnl_parse_err *err, ctx.cb = cb; ctx.format = type; + ctx.flags = 0; ctx.set_list = nftnl_set_list_alloc(); if (ctx.set_list == NULL) -- cgit v1.2.3