diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-05 13:06:38 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-05 13:06:38 +0000 |
commit | 4ba9cd1fb3c0b58d269911f126424b67d0c4a89d (patch) | |
tree | 76580bc8ae4155f5760b20d0b4c06b328eb0ed6f /sys | |
parent | c8a65b5092dcb05e1d1bb1241d24175a275c23c9 (diff) |
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
Diffstat (limited to 'sys')
-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 * |