summaryrefslogtreecommitdiff
path: root/sbin/dump
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 /sbin/dump
parentbe524287dc216d876f995eddcaf32762c702c6e9 (diff)
use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index ce24fd1224c..8995809a03d 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.41 2007/06/03 20:16:08 millert Exp $ */
+/* $OpenBSD: main.c,v 1.42 2007/09/02 15:19:23 deraadt Exp $ */
/* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 4/15/94";
#else
-static const char rcsid[] = "$OpenBSD: main.c,v 1.41 2007/06/03 20:16:08 millert Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.42 2007/09/02 15:19:23 deraadt Exp $";
#endif
#endif /* not lint */
@@ -652,7 +652,7 @@ obsolete(int *argcp, char **argvp[])
return;
/* Allocate space for new arguments. */
- if ((*argvp = nargv = malloc((argc + 1) * sizeof(char *))) == NULL ||
+ if ((*argvp = nargv = calloc(argc + 1, sizeof(char *))) == NULL ||
(p = flagsp = malloc(strlen(ap) + 2)) == NULL)
err(1, NULL);