From 42797f72106dffd348e195b5d8d81bfe1eaff3d6 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Tue, 16 May 2017 12:33:42 +0200
Subject: [PATCH] ruleset: Initialize ctx.flags before calling
nftnl_ruleset_ctx_set()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1353322
Upstream Status: libnftnl commit 6257aaf53ede6
commit 6257aaf53ede6456e28b0224d215c811f534ff35
Author: Phil Sutter <phil@nwl.cc>
Date: Fri Aug 12 01:33:39 2016 +0200
ruleset: Initialize ctx.flags before calling nftnl_ruleset_ctx_set()
The called function otherwise accesses uninitialized data.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/ruleset.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/ruleset.c b/src/ruleset.c
index 414b7c4..ec4cb1d 100644
--- a/src/ruleset.c
+++ b/src/ruleset.c
@@ -555,6 +555,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)
@@ -686,6 +687,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)
--
1.8.3.1