From: bluhm Date: Tue, 26 Mar 2024 10:01:57 +0000 (+0000) Subject: Avoid NULL pointer dereference in routing table an_match(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d75bd533f0ad534486488013eeeaa642ea1f5f58;p=openbsd Avoid NULL pointer dereference in routing table an_match(). OK mvs@ --- diff --git a/sys/net/rtable.c b/sys/net/rtable.c index 38282ebd77e..48108ce025c 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.85 2023/11/12 17:51:40 bluhm Exp $ */ +/* $OpenBSD: rtable.c,v 1.86 2024/03/26 10:01:57 bluhm Exp $ */ /* * Copyright (c) 2014-2016 Martin Pieuchot @@ -875,7 +875,7 @@ an_match(struct art_node *an, const struct sockaddr *dst, int plen) return (0); rt = SRPL_FIRST(&sr, &an->an_rtlist); - match = (memcmp(rt->rt_dest, dst, dst->sa_len) == 0); + match = (rt != NULL && memcmp(rt->rt_dest, dst, dst->sa_len) == 0); SRPL_LEAVE(&sr); return (match);