diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-02 15:19:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-02 15:19:41 +0000 |
commit | 6ebd04219f0d749c87a763e8afb578dfcd5223cc (patch) | |
tree | bb0f29e0a3791fff88551c93f5d4ba7113bdba43 /sbin/ccdconfig | |
parent | be524287dc216d876f995eddcaf32762c702c6e9 (diff) |
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'sbin/ccdconfig')
-rw-r--r-- | sbin/ccdconfig/ccdconfig.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index e45ba95c7d9..4d9188f65c0 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ccdconfig.c,v 1.32 2007/08/06 19:16:05 sobrado Exp $ */ +/* $OpenBSD: ccdconfig.c,v 1.33 2007/09/02 15:19:23 deraadt Exp $ */ /* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */ /*- @@ -278,7 +278,7 @@ do_single(int argc, char *argv[], int action) } /* Next is the list of disks to make the ccd from. */ - disks = malloc(argc * sizeof(char *)); + disks = calloc(argc, sizeof(char *)); if (disks == NULL) { warnx("no memory to configure ccd"); goto done; |