netlink: fix NULL check in the default route snl(3) parser.

CID:		1506959
MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2023-04-02 12:44:20 +00:00
parent 27cbc1a7fe
commit 4aeb939ecf

View file

@ -82,6 +82,8 @@ nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, const void *arg _
size_t sz = (max_nhops + 2) * sizeof(struct rta_mpath_nh);
struct rta_mpath *mp = snl_allocz(ss, sz);
if (mp == NULL)
return (false);
mp->num_nhops = 0;
for (rtnh = (struct rtnexthop *)(void *)(nla + 1); data_len > 0; ) {