path: root/src
diff options
authorPhil Sutter <>2017-12-14 20:40:22 +0100
committerPablo Neira Ayuso <>2017-12-15 16:22:46 +0100
commit8f228f6842494ea7f83ff9aaa19ec32681628c9f (patch)
tree4ad978e83f9c24f6a7ca3c7f7495e1229bfd29b8 /src
parentfd9ab5c922cd8d15e8f0251c70bcd9532158e9b0 (diff)
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 <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
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) {