@@ -816,7 +816,7 @@ static int nftnl_chain_do_parse(struct nftnl_chain *c, enum nftnl_parse_type typ
enum nftnl_parse_input input)
{
int ret;
- struct nftnl_parse_err perr;
+ struct nftnl_parse_err perr = {};
switch (type) {
case NFTNL_PARSE_XML:
@@ -700,7 +700,7 @@ static int nftnl_rule_do_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
enum nftnl_parse_input input)
{
int ret;
- struct nftnl_parse_err perr;
+ struct nftnl_parse_err perr = {};
switch (type) {
case NFTNL_PARSE_XML:
@@ -781,7 +781,7 @@ static int nftnl_set_do_parse(struct nftnl_set *s, enum nftnl_parse_type type,
enum nftnl_parse_input input)
{
int ret;
- struct nftnl_parse_err perr;
+ struct nftnl_parse_err perr = {};
switch (type) {
case NFTNL_PARSE_XML:
@@ -360,7 +360,7 @@ static int nftnl_table_do_parse(struct nftnl_table *t, enum nftnl_parse_type typ
enum nftnl_parse_input input)
{
int ret;
- struct nftnl_parse_err perr;
+ struct nftnl_parse_err perr = {};
switch (type) {
case NFTNL_PARSE_XML:
Although the 'err' pointer should be interesting for users only if the parser returned non-zero, having it point to uninitialized data is generally a bad thing. Signed-off-by: Phil Sutter <phil@nwl.cc> --- src/chain.c | 2 +- src/rule.c | 2 +- src/set.c | 2 +- src/table.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)