diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-01-05 19:08:20 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-01-05 19:08:20 +0000 |
commit | 64aee5979f08f78bdbff4796d592b0fa1524876d (patch) | |
tree | 8016cee970c91aad71eeb232942135194568447c /sys/net/route.c | |
parent | 528dae80d83bc80ce3b51ee2c946fda6da31ab55 (diff) |
make sure all callers of rtlabel_id2name check for a null return value.
all the original ones did, the recently added ones for labels per interface
didn't. no cookie for reyk ;(
ok deraadt
Diffstat (limited to 'sys/net/route.c')
-rw-r--r-- | sys/net/route.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/route.c b/sys/net/route.c index 38ab3e3a5fa..4258c2eef44 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.86 2007/09/17 05:06:20 pyr Exp $ */ +/* $OpenBSD: route.c,v 1.87 2008/01/05 19:08:19 henning Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1029,8 +1029,8 @@ rtinit(struct ifaddr *ifa, int cmd, int flags) info.rti_flags = flags | ifa->ifa_flags; info.rti_info[RTAX_DST] = dst; info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; - if (ifa->ifa_ifp->if_rtlabelid) { - label = rtlabel_id2name(ifa->ifa_ifp->if_rtlabelid); + if (ifa->ifa_ifp->if_rtlabelid && + (label = rtlabel_id2name(ifa->ifa_ifp->if_rtlabelid)) != NULL) { bzero(&sa_rl, sizeof(sa_rl)); sa_rl.sr_len = sizeof(sa_rl); sa_rl.sr_family = AF_UNSPEC; |