diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 04:20:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 04:20:58 +0000 |
commit | 3a5ac5e19a8d6e26f54768bfdb1875d7d615d84d (patch) | |
tree | 4a05be548bc04e3a18961ab5305be5d103490ae0 /usr.sbin | |
parent | a2c4d935e0c40666e9bdda343115c7b39b052c6b (diff) |
use reallocarray() instead of realloc() to handle potential integer overflow; ok doug
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cron/env.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/cron/env.c b/usr.sbin/cron/env.c index 099957c6384..8fa993ac447 100644 --- a/usr.sbin/cron/env.c +++ b/usr.sbin/cron/env.c @@ -1,4 +1,4 @@ -/* $OpenBSD: env.c,v 1.23 2011/01/18 14:29:21 millert Exp $ */ +/* $OpenBSD: env.c,v 1.24 2014/10/08 04:20:57 deraadt Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -99,8 +99,7 @@ env_set(char **envp, char *envstr) { */ if ((envtmp = strdup(envstr)) == NULL) return (NULL); - p = (char **) realloc((void *) envp, - (size_t) ((count+1) * sizeof(char **))); + p = reallocarray(envp, count+1, sizeof(char **)); if (p == NULL) { free(envtmp); return (NULL); |