diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2013-07-08 15:48:17 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2013-07-08 15:48:17 +0000 |
commit | 4da971a72e06ed058b49fe2b31ba41646de36e52 (patch) | |
tree | c92c7c5dd2dd82e7c95a6b7597efbf198d8a7bef /app/cwm/group.c | |
parent | 01bae6830b63e90d70d81aa607126141d8774cfd (diff) |
replace a few (x)malloc with (x)calloc to prevent potential integer
overflows; from Tiago Cunha
Diffstat (limited to 'app/cwm/group.c')
-rw-r--r-- | app/cwm/group.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/cwm/group.c b/app/cwm/group.c index bf8f6942c..9a66e7489 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: group.c,v 1.76 2013/05/06 16:03:11 okan Exp $ + * $OpenBSD: group.c,v 1.77 2013/07/08 15:48:16 okan Exp $ */ #include <sys/param.h> @@ -430,8 +430,8 @@ group_update_names(struct screen_ctx *sc) } } - strings = xmalloc((nstrings < CALMWM_NGROUPS ? CALMWM_NGROUPS : - nstrings) * sizeof(*strings)); + strings = xcalloc((nstrings < CALMWM_NGROUPS ? CALMWM_NGROUPS : + nstrings), sizeof(*strings)); p = (char *)prop_ret; while (n < nstrings) { |