diff options
author | Thomas Haller <thaller@redhat.com> | 2023-09-20 16:26:07 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-09-20 18:22:48 +0200 |
commit | c4186c5376ee73efff005dbd23dd73a8e06e6ad8 (patch) | |
tree | 4dc0f9d2070f88f982f9e0b6b76f2c2fd65ddea5 /src/netlink.c | |
parent | ded675121cac6877938148dc07e1653b58441864 (diff) |
netlink: handle invalid etype in set_make_key()
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>
Diffstat (limited to 'src/netlink.c')
-rw-r--r-- | src/netlink.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c index 2489e986..70ebf382 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -896,6 +896,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) |