summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/common.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-09-02 15:19:07 +0000
committerderaadt <deraadt@openbsd.org>2007-09-02 15:19:07 +0000
commit1ed98fdf61d9dd29369f246109081408082ce54d (patch)
treead7631e58c83830d1fc51cbadb9a2da53c1abfb7 /usr.sbin/lpr/common_source/common.c
parentOpenCVS server init-support with OpenCVS and GNU cvs clients. (diff)
downloadwireguard-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/lpr/common_source/common.c')
-rw-r--r--usr.sbin/lpr/common_source/common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c
index 0ed7907fb96..3635ab3f129 100644
--- a/usr.sbin/lpr/common_source/common.c
+++ b/usr.sbin/lpr/common_source/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.31 2007/03/16 20:03:48 stevesk Exp $ */
+/* $OpenBSD: common.c,v 1.32 2007/09/02 15:19:38 deraadt Exp $ */
/* $NetBSD: common.c,v 1.21 2000/08/09 14:28:50 itojun Exp $ */
/*
@@ -39,7 +39,7 @@
#if 0
static const char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95";
#else
-static const char rcsid[] = "$OpenBSD: common.c,v 1.31 2007/03/16 20:03:48 stevesk Exp $";
+static const char rcsid[] = "$OpenBSD: common.c,v 1.32 2007/09/02 15:19:38 deraadt Exp $";
#endif
#endif /* not lint */
@@ -257,7 +257,7 @@ getq(struct queue ***namelist)
* and dividing it by a multiple of the minimum size entry.
*/
arraysz = (stbuf.st_size / 24);
- queue = (struct queue **)malloc(arraysz * sizeof(struct queue *));
+ queue = (struct queue **)calloc(arraysz, sizeof(struct queue *));
if (queue == NULL)
goto errdone;