From 307bdafb53adb68f78816dec22e45dd18960ec33 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Mon, 22 Jul 2019 17:34:25 +0200
Subject: [PATCH] object: Avoid returning garbage in nftnl_obj_do_parse()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1510538
Upstream Status: libnftnl commit 8f228f6842494
commit 8f228f6842494ea7f83ff9aaa19ec32681628c9f
Author: Phil Sutter <phil@nwl.cc>
Date: Thu Dec 14 20:40:22 2017 +0100
object: Avoid returning garbage in nftnl_obj_do_parse()
It may happen that 'perr' variable does not get initialized, so making
parameter 'err' point to it in any case is error-prone. Avoid this by
initializing 'perr' upon declaration.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/object.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/object.c b/src/object.c
index 9a4ee71..da3423b 100644
--- a/src/object.c
+++ b/src/object.c
@@ -358,7 +358,7 @@ static int nftnl_obj_do_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
const void *data, struct nftnl_parse_err *err,
enum nftnl_parse_input input)
{
- struct nftnl_parse_err perr;
+ struct nftnl_parse_err perr = {};
int ret;
switch (type) {
--
1.8.3.1