From cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:42 -0700 Subject: Use calloc to zero fill buffers being allocated for replies & events Ensures padding bytes are zero-filled Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone --- xfixes/region.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xfixes/region.c') diff --git a/xfixes/region.c b/xfixes/region.c index 89675e52d..0e9ca443f 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -557,7 +557,8 @@ ProcXFixesFetchRegion(ClientPtr client) pBox = RegionRects(pRegion); nBox = RegionNumRects(pRegion); - reply = malloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle)); + reply = calloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle), + 1); if (!reply) return BadAlloc; reply->type = X_Reply; -- cgit v1.2.3