diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-29 10:09:10 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-29 10:09:10 +0000 |
commit | 2f0a319d9a1ae23cb3b5da7aea74db0421391da9 (patch) | |
tree | 967a9e255e549e8b8b1d3d3c9f7dd3381698695f /usr.bin/netstat | |
parent | c8956c8e05f612c123927db30c0de0b4ec707772 (diff) |
Netstat has the same issue problem as route when printing a default inet6
route. Need to typecast the sizeof() to int so that the compare works.
Having a negativ lim is OK. Reported by Björn Ketelaars. OK deraadt@
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/show.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c index ac9f811a08d..0cf2c03ac24 100644 --- a/usr.bin/netstat/show.c +++ b/usr.bin/netstat/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.3 2006/11/17 01:11:23 itojun Exp $ */ +/* $OpenBSD: show.c,v 1.4 2006/12/29 10:09:09 claudio Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -683,7 +683,7 @@ netname6(struct sockaddr_in6 *sa6, struct sockaddr_in6 *mask) masklen = 0; if (mask) { lim = mask->sin6_len - offsetof(struct sockaddr_in6, sin6_addr); - lim = lim < sizeof(struct in6_addr) ? + lim = lim < (int)sizeof(struct in6_addr) ? lim : sizeof(struct in6_addr); for (p = (u_char *)&mask->sin6_addr, i = 0; i < lim; p++) { if (final && *p) { |