diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-10-08 04:11:29 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-10-08 04:11:29 +0000 |
commit | 9be39b80d61237e184b8aca283cfd3a7afa5efd3 (patch) | |
tree | 15ed7fdd6c9ae9ad13e0794f5767b4bcb5b9d99b /usr.bin/systat/netstat.c | |
parent | 943bd3702ccb622601eb6c5fdd3439b2fba96595 (diff) |
userland reallocarray audit.
Replace malloc() and realloc() calls that may have integer overflow in the
multiplication of the size argument with reallocarray().
ok deraadt@
Diffstat (limited to 'usr.bin/systat/netstat.c')
-rw-r--r-- | usr.bin/systat/netstat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index ccf5db747d4..5ee94d3a701 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netstat.c,v 1.40 2014/08/14 12:55:50 mpi Exp $ */ +/* $OpenBSD: netstat.c,v 1.41 2014/10/08 04:10:04 doug Exp $ */ /* $NetBSD: netstat.c,v 1.3 1995/06/18 23:53:07 cgd Exp $ */ /*- @@ -163,7 +163,7 @@ next_ns(void) size_t a = num_alloc + ADD_ALLOC; if (a < num_alloc) return NULL; - ni = realloc(netinfos, a * sizeof(*ni)); + ni = reallocarray(netinfos, a, sizeof(*ni)); if (ni == NULL) return NULL; netinfos = ni; |