summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
authorokan <okan>2013-07-08 15:48:16 +0000
committerokan <okan>2013-07-08 15:48:16 +0000
commitfe439f2b965b9ee6e9dc9a6d8e2ecb443f86e788 (patch)
tree95a1c4c74a8a16b42e68adca5f251b64ec0c84ed /group.c
parent7a7e5cd59254ab17f1f37affa868858160eca07a (diff)
downloadcwm-fe439f2b965b9ee6e9dc9a6d8e2ecb443f86e788.tar.gz
cwm-fe439f2b965b9ee6e9dc9a6d8e2ecb443f86e788.tar.xz
cwm-fe439f2b965b9ee6e9dc9a6d8e2ecb443f86e788.zip
replace a few (x)malloc with (x)calloc to prevent potential integer
overflows; from Tiago Cunha
Diffstat (limited to 'group.c')
-rw-r--r--group.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/group.c b/group.c
index f7a0a2d..a25972a 100644
--- a/group.c
+++ b/group.c
@@ -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) {