From 5dbdc50aa7dc6cb2653c7b73f6ea46e64f8c8014 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 1 Jun 2020 20:20:29 +0200 Subject: [PATCH] check return value of nftnl_expr_get() --- miniupnpd/netfilter_nft/nftnlrdr_misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miniupnpd/netfilter_nft/nftnlrdr_misc.c b/miniupnpd/netfilter_nft/nftnlrdr_misc.c index 2bde5ba..9c3c677 100644 --- a/miniupnpd/netfilter_nft/nftnlrdr_misc.c +++ b/miniupnpd/netfilter_nft/nftnlrdr_misc.c @@ -365,6 +365,10 @@ parse_rule_cmp(struct nftnl_expr *e, rule_t *r) } data_val = nftnl_expr_get(e, NFTNL_EXPR_CMP_DATA, &data_len); + if (data_val == NULL) { + log_error( "parse_rule_cmp: nftnl_expr_get(NFTNL_EXPR_CMP_DATA) returned NULL"); + return; + } switch (r->reg1_type) { case RULE_REG_IIF: