summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-20 16:26:07 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-03 12:23:37 +0100
commit0232da0b12989cc1aa952c58b488e8b57c40de14 (patch)
tree6bed50ca46febea4d1461d0fc4de6f8291d54e35
parente7361e9b7bc1b583692ea572a133d1c6e942b83f (diff)
netlink: handle invalid etype in set_make_key()
commit c4186c5376ee73efff005dbd23dd73a8e06e6ad8 upstream. It's not clear to me, what ensures that the etype is always valid. Handle a NULL. Fixes: 6e48df5329ea ('src: add "typeof" build/parse/print support') Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/netlink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c
index a3407121..8d517c10 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -893,6 +893,8 @@ static struct expr *set_make_key(const struct nftnl_udata *attr)
etype = nftnl_udata_get_u32(ud[NFTNL_UDATA_SET_TYPEOF_EXPR]);
ops = expr_ops_by_type(etype);
+ if (!ops)
+ return NULL;
expr = ops->parse_udata(ud[NFTNL_UDATA_SET_TYPEOF_DATA]);
if (!expr)