diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-06-15 16:55:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-06-15 16:55:39 +0000 |
commit | 9a13b2d5e114faf066c473bbac06a7b1b6832d89 (patch) | |
tree | aa7f6cb0e84d64ca5807ffabcfdd86312e12adf1 /sbin/route/show.c | |
parent | ab22c97f9ba805482e200a7f43eb1c6c581adc26 (diff) |
do not crash on 'route flush'
Diffstat (limited to 'sbin/route/show.c')
-rw-r--r-- | sbin/route/show.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/route/show.c b/sbin/route/show.c index dd8aa449453..6b5caa10481 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.28 2004/06/12 09:40:49 claudio Exp $ */ +/* $OpenBSD: show.c,v 1.29 2004/06/15 16:55:38 deraadt Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else -static const char rcsid[] = "$OpenBSD: show.c,v 1.28 2004/06/12 09:40:49 claudio Exp $"; +static const char rcsid[] = "$OpenBSD: show.c,v 1.29 2004/06/15 16:55:38 deraadt Exp $"; #endif #endif /* not lint */ @@ -654,11 +654,11 @@ netname(struct sockaddr *sa, struct sockaddr *mask) case AF_INET: return netname4(((struct sockaddr_in *)sa)->sin_addr.s_addr, - ((struct sockaddr_in *)mask)->sin_addr.s_addr); + mask ? ((struct sockaddr_in *)mask)->sin_addr.s_addr : NULL); #ifdef INET6 case AF_INET6: return netname6((struct sockaddr_in6 *)sa, - (struct sockaddr_in6 *)mask); + mask ? (struct sockaddr_in6 *)mask : NULL); #endif case AF_NS: |