]> git.ipfire.org Git - thirdparty/libnftnl.git/commitdiff
ruleset: Initialize ctx.flags before calling nftnl_ruleset_ctx_set()
authorPhil Sutter <phil@nwl.cc>
Thu, 11 Aug 2016 23:33:39 +0000 (01:33 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 11 Aug 2016 23:56:53 +0000 (01:56 +0200)
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

index 666bcc7a246b68c6676b338aed255ec3e739d303..2f3c11066cbbbf0a99bd93a34cdbbb1591598689 100644 (file)
@@ -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)