git: 4aeb939ecf8b - main - netlink: fix NULL check in the default route snl(3) parser.

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Sun, 02 Apr 2023 12:45:27 UTC
The branch main has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=4aeb939ecf8b2b6913ae51d828416743bad812ab

commit 4aeb939ecf8b2b6913ae51d828416743bad812ab
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-04-02 12:44:20 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-04-02 12:44:20 +0000

    netlink: fix NULL check in the default route snl(3) parser.
    
    CID:            1506959
    MFC after:      2 weeks
---
 sys/netlink/netlink_snl_route_parsers.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/netlink/netlink_snl_route_parsers.h b/sys/netlink/netlink_snl_route_parsers.h
index ba9ead461c80..1d6680cb5597 100644
--- a/sys/netlink/netlink_snl_route_parsers.h
+++ b/sys/netlink/netlink_snl_route_parsers.h
@@ -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; ) {