diff options
| author | 2007-09-02 15:19:07 +0000 | |
|---|---|---|
| committer | 2007-09-02 15:19:07 +0000 | |
| commit | 1ed98fdf61d9dd29369f246109081408082ce54d (patch) | |
| tree | ad7631e58c83830d1fc51cbadb9a2da53c1abfb7 /usr.sbin/procmap/procmap.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 'usr.sbin/procmap/procmap.c')
| -rw-r--r-- | usr.sbin/procmap/procmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c index fe724a7788d..682309d91d5 100644 --- a/usr.sbin/procmap/procmap.c +++ b/usr.sbin/procmap/procmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procmap.c,v 1.25 2007/05/31 18:22:25 thib Exp $ */ +/* $OpenBSD: procmap.c,v 1.26 2007/09/02 15:19:40 deraadt Exp $ */ /* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */ /* @@ -870,7 +870,7 @@ load_name_cache(kvm_t *kd) LIST_INIT(&lcache); _KDEREF(kd, nchash_addr, &nchash, sizeof(nchash)); - nchashtbl = malloc(sizeof(nchashtbl) * (int)nchash); + nchashtbl = calloc(sizeof(nchashtbl), (int)nchash); if (nchashtbl == NULL) err(1, "load_name_cache"); _KDEREF(kd, nchashtbl_addr, nchashtbl, |
