summaryrefslogtreecommitdiff
path: root/usr.bin/bdes
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-02 15:19:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-02 15:19:41 +0000
commit6ebd04219f0d749c87a763e8afb578dfcd5223cc (patch)
treebb0f29e0a3791fff88551c93f5d4ba7113bdba43 /usr.bin/bdes
parentbe524287dc216d876f995eddcaf32762c702c6e9 (diff)
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'usr.bin/bdes')
-rw-r--r--usr.bin/bdes/bdes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/bdes/bdes.c b/usr.bin/bdes/bdes.c
index fdbb422f8bc..768fc508a15 100644
--- a/usr.bin/bdes/bdes.c
+++ b/usr.bin/bdes/bdes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bdes.c,v 1.14 2004/05/16 18:49:12 otto Exp $ */
+/* $OpenBSD: bdes.c,v 1.15 2007/09/02 15:19:31 deraadt Exp $ */
/* $NetBSD: bdes.c,v 1.2 1995/03/26 03:33:19 glass Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)bdes.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: bdes.c,v 1.14 2004/05/16 18:49:12 otto Exp $";
+static char rcsid[] = "$OpenBSD: bdes.c,v 1.15 2007/09/02 15:19:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -200,7 +200,7 @@ main(int ac, char *av[])
*/
argc = ac;
ac = 1;
- argv = malloc((argc + 1) * sizeof(char *));
+ argv = calloc(argc + 1, sizeof(char *));
if (argv == NULL)
errx(1, "out of memory");
for (i = 0; i < argc; ++i) {