diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-04-06 18:03:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-04-06 18:03:53 +0000 |
commit | e14697eb30d3a11a8781069cc3c04e3e26de1b0d (patch) | |
tree | 1ebf0c2670006542f7e06df02d223873338aeec1 /usr.sbin/rarpd/rarpd.c | |
parent | 9ee506e53e16e221c10a986355553b7f258ddf31 (diff) |
BIOCGBLEN is using a u_int, not an int
and casting to size_t for malloc is better
Diffstat (limited to 'usr.sbin/rarpd/rarpd.c')
-rw-r--r-- | usr.sbin/rarpd/rarpd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/rarpd/rarpd.c b/usr.sbin/rarpd/rarpd.c index f7121967388..c5ca392a21b 100644 --- a/usr.sbin/rarpd/rarpd.c +++ b/usr.sbin/rarpd/rarpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rarpd.c,v 1.52 2010/08/29 12:33:25 chl Exp $ */ +/* $OpenBSD: rarpd.c,v 1.53 2012/04/06 18:03:52 deraadt Exp $ */ /* $NetBSD: rarpd.c,v 1.25 1998/04/23 02:48:33 mrg Exp $ */ /* @@ -384,9 +384,10 @@ rarp_check(u_char *p, int len) void rarp_loop(void) { - int cc, fd, fdsn, bufsize, maxfd = 0; + int cc, fd, fdsn, maxfd = 0; + u_int bufsize; fd_set *fdsp, *lfdsp; - u_char *buf, *bp, *ep; + u_char *buf, *bp, *ep; struct if_info *ii; if (iflist == 0) { @@ -397,7 +398,7 @@ rarp_loop(void) error(FATAL, "BIOCGBLEN: %s", strerror(errno)); /* NOTREACHED */ } - buf = (u_char *) malloc((unsigned) bufsize); + buf = (u_char *) malloc((size_t) bufsize); if (buf == 0) { error(FATAL, "malloc: %s", strerror(errno)); /* NOTREACHED */ |