mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Use calloc to zero fill buffers being allocated for replies & events
Ensures padding bytes are zero-filled Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
@@ -531,7 +531,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client)
|
||||
num = pFormat->index.nvalues;
|
||||
rlength = (sizeof(xRenderQueryPictIndexValuesReply) +
|
||||
num * sizeof(xIndexValue));
|
||||
reply = (xRenderQueryPictIndexValuesReply *) malloc(rlength);
|
||||
reply = (xRenderQueryPictIndexValuesReply *) calloc(1, rlength);
|
||||
if (!reply)
|
||||
return BadAlloc;
|
||||
|
||||
@@ -1688,7 +1688,7 @@ ProcRenderQueryFilters(ClientPtr client)
|
||||
}
|
||||
len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName);
|
||||
total_bytes = sizeof(xRenderQueryFiltersReply) + (len << 2);
|
||||
reply = (xRenderQueryFiltersReply *) malloc(total_bytes);
|
||||
reply = (xRenderQueryFiltersReply *) calloc(1, total_bytes);
|
||||
if (!reply)
|
||||
return BadAlloc;
|
||||
aliases = (INT16 *) (reply + 1);
|
||||
|
||||
Reference in New Issue
Block a user