aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/render
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-02-28 23:11:23 +0100
committerUlrich Sibiller <uli42@gmx.de>2019-02-28 23:11:23 +0100
commitc81a45785970aa198736d8dc578beb2d7bbd1b2f (patch)
treeac76fbaa64eb26f0a1cf7863a7eca6bff9ceb9a6 /nx-X11/programs/Xserver/render
parenta70e36c8114c0358258e8c3964b9d897884e265e (diff)
downloadnx-libs-c81a45785970aa198736d8dc578beb2d7bbd1b2f.tar.gz
nx-libs-c81a45785970aa198736d8dc578beb2d7bbd1b2f.tar.bz2
nx-libs-c81a45785970aa198736d8dc578beb2d7bbd1b2f.zip
Use calloc to zero fill buffers being allocated for replies & events
commit cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Mon Jul 9 19:12:42 2012 -0700 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> Attributes ArcticaProject/nx-libs#382
Diffstat (limited to 'nx-X11/programs/Xserver/render')
-rw-r--r--nx-X11/programs/Xserver/render/render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c
index 3c1cbe53c..78677b752 100644
--- a/nx-X11/programs/Xserver/render/render.c
+++ b/nx-X11/programs/Xserver/render/render.c
@@ -580,7 +580,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;
@@ -1746,7 +1746,7 @@ ProcRenderQueryFilters (ClientPtr client)
}
len = ((nnames + 1) >> 1) + ((nbytesName + 3) >> 2);
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);