summaryrefslogtreecommitdiffstats
path: root/usr.bin/window/wwinit.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.bin/window/wwinit.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.bin/window/wwinit.c')
-rw-r--r--usr.bin/window/wwinit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/window/wwinit.c b/usr.bin/window/wwinit.c
index aee8ea603df..81407abebbd 100644
--- a/usr.bin/window/wwinit.c
+++ b/usr.bin/window/wwinit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwinit.c,v 1.17 2006/01/02 16:20:56 millert Exp $ */
+/* $OpenBSD: wwinit.c,v 1.18 2007/09/02 15:19:35 deraadt Exp $ */
/* $NetBSD: wwinit.c,v 1.11 1996/02/08 21:49:07 mycroft Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwinit.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: wwinit.c,v 1.17 2006/01/02 16:20:56 millert Exp $";
+static char rcsid[] = "$OpenBSD: wwinit.c,v 1.18 2007/09/02 15:19:35 deraadt Exp $";
#endif
#endif /* not lint */
@@ -265,7 +265,7 @@ wwinit()
for (i = 0; i < wwnrow; i++)
wwtouched[i] = 0;
- wwupd = (struct ww_update *) malloc(wwnrow * sizeof *wwupd);
+ wwupd = (struct ww_update *) calloc(wwnrow, sizeof *wwupd);
if (wwupd == 0) {
wwerrno = WWE_NOMEM;
goto bad;