replace a few (x)malloc with (x)calloc to prevent potential integer

overflows; from Tiago Cunha
This commit is contained in:
okan
2013-07-08 15:48:16 +00:00
parent 7a7e5cd592
commit fe439f2b96
2 changed files with 5 additions and 5 deletions

View File

@@ -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) {