diff options
author | 2007-09-02 15:19:07 +0000 | |
---|---|---|
committer | 2007-09-02 15:19:07 +0000 | |
commit | 1ed98fdf61d9dd29369f246109081408082ce54d (patch) | |
tree | ad7631e58c83830d1fc51cbadb9a2da53c1abfb7 /lib/libc/rpc/pmap_rmt.c | |
parent | OpenCVS server init-support with OpenCVS and GNU cvs clients. (diff) | |
download | wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.tar.xz wireguard-openbsd-1ed98fdf61d9dd29369f246109081408082ce54d.zip |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'lib/libc/rpc/pmap_rmt.c')
-rw-r--r-- | lib/libc/rpc/pmap_rmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index 76adaddd2a3..2265041a797 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_rmt.c,v 1.27 2006/09/22 18:42:04 otto Exp $ */ +/* $OpenBSD: pmap_rmt.c,v 1.28 2007/09/02 15:19:17 deraadt Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape @@ -172,7 +172,7 @@ newgetbroadcastnets(struct in_addr **addrsp) } } - addrs = (struct in_addr *)malloc(n * sizeof(*addrs)); + addrs = (struct in_addr *)calloc(n, sizeof(*addrs)); if (addrs == NULL) { freeifaddrs(ifap); return 0; |