artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02a8271
)
Avoid NULL pointer dereference in routing table an_match().
author
bluhm
<bluhm@openbsd.org>
Tue, 26 Mar 2024 10:01:57 +0000
(10:01 +0000)
committer
bluhm
<bluhm@openbsd.org>
Tue, 26 Mar 2024 10:01:57 +0000
(10:01 +0000)
OK mvs@
sys/net/rtable.c
patch
|
blob
|
history
diff --git
a/sys/net/rtable.c
b/sys/net/rtable.c
index
38282eb
..
48108ce
100644
(file)
--- a/
sys/net/rtable.c
+++ b/
sys/net/rtable.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: rtable.c,v 1.8
5 2023/11/12 17:51:40
bluhm Exp $ */
+/* $OpenBSD: rtable.c,v 1.8
6 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);