summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/dhclient.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 /sbin/dhclient/dhclient.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 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 9f07d8fb8b3..b3f6df739cd 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.114 2007/08/14 15:29:18 stevesk Exp $ */
+/* $OpenBSD: dhclient.c,v 1.115 2007/09/02 15:19:23 deraadt Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -1571,7 +1571,7 @@ priv_script_init(char *reason, char *medium)
client->scriptEnvsize = 100;
if (client->scriptEnv == NULL)
client->scriptEnv =
- malloc(client->scriptEnvsize * sizeof(char *));
+ calloc(client->scriptEnvsize, sizeof(char *));
if (client->scriptEnv == NULL)
error("script_init: no memory for environment");