aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2013-07-08 15:48:16 +0000
committerokan2013-07-08 15:48:16 +0000
commita56db3439f26c4bda09fe7fdd665641680a6dad7 (patch)
tree766d854d9d4b379aba98573faecf89b906b2fc57 /group.c
parent72d22295d234444996cb86245dcc179e24adc895 (diff)
downloadcwm-a56db3439f26c4bda09fe7fdd665641680a6dad7.tar.gz
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/group.c b/group.c
index bf8f694..9a66e74 100644
--- a/group.c
+++ b/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) {