diff options
author | 2008-05-05 13:06:37 +0000 | |
---|---|---|
committer | 2008-05-05 13:06:37 +0000 | |
commit | 1eddcec7e79d3634ec764abcb6fe8b44a42da3aa (patch) | |
tree | 5b3806b975e259b290f94379fe62aac53d34a697 | |
parent | remove a useless refcnt in pf_state_key. (diff) | |
download | wireguard-openbsd-1eddcec7e79d3634ec764abcb6fe8b44a42da3aa.tar.xz wireguard-openbsd-1eddcec7e79d3634ec764abcb6fe8b44a42da3aa.zip |
in rt_gettable, we unfortunately have to check for rt_tables[id] != NULL
before returning rt_tables[id][af2rtafidx[af]. when you created tables
and left a hole (0 and 2 exist, 1 does not) it is possible to hit that
case. issue found & ok claudio
-rw-r--r-- | sys/net/route.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 4258c2eef44..6be379a9c08 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.87 2008/01/05 19:08:19 henning Exp $ */ +/* $OpenBSD: route.c,v 1.88 2008/05/05 13:06:37 henning Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1238,7 +1238,7 @@ rt_timer_add(struct rtentry *rt, void (*func)(struct rtentry *, struct radix_node_head * rt_gettable(sa_family_t af, u_int id) { - return (rt_tables[id][af2rtafidx[af]]); + return (rt_tables[id] ? rt_tables[id][af2rtafidx[af]] : NULL); } struct radix_node * |