summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2008-01-05 19:08:20 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2008-01-05 19:08:20 +0000
commit64aee5979f08f78bdbff4796d592b0fa1524876d (patch)
tree8016cee970c91aad71eeb232942135194568447c /sys/net/if.c
parent528dae80d83bc80ce3b51ee2c946fda6da31ab55 (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/if.c')
-rw-r--r--sys/net/if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 7068202e0d7..272c773336c 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.167 2008/01/05 07:26:04 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.168 2008/01/05 19:08:19 henning Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1290,8 +1290,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
break;
case SIOCGIFRTLABEL:
- if (ifp->if_rtlabelid) {
- label = rtlabel_id2name(ifp->if_rtlabelid);
+ if (ifp->if_rtlabelid &&
+ (label = rtlabel_id2name(ifp->if_rtlabelid)) != NULL) {
strlcpy(ifrtlabelbuf, label, RTLABEL_LEN);
error = copyoutstr(ifrtlabelbuf, ifr->ifr_data,
RTLABEL_LEN, &bytesdone);