diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-03-01 11:59:55 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-03-01 11:59:55 +0100 |
commit | d156ce5ab6afa3bc67189f4985e1517d5aca52b3 (patch) | |
tree | 76679bd38f93ec2b069e20db90d4e602d368d0ec /nx-X11/programs/Xserver/render | |
parent | a70e36c8114c0358258e8c3964b9d897884e265e (diff) | |
parent | e7a50079ed90bd9f9f292d3f40ed3905c034a4cc (diff) | |
download | nx-libs-d156ce5ab6afa3bc67189f4985e1517d5aca52b3.tar.gz nx-libs-d156ce5ab6afa3bc67189f4985e1517d5aca52b3.tar.bz2 nx-libs-d156ce5ab6afa3bc67189f4985e1517d5aca52b3.zip |
Merge branch 'uli42-pr/xfixes_memset' into 3.6.x
Attributes GH PR #788: https://github.com/ArcticaProject/nx-libs/pull/788
Diffstat (limited to 'nx-X11/programs/Xserver/render')
-rw-r--r-- | nx-X11/programs/Xserver/render/render.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 3c1cbe53c..e4d8a3f76 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -274,7 +274,13 @@ static int ProcRenderQueryVersion (ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient (client); - xRenderQueryVersionReply rep; + xRenderQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_RENDER_MAJOR_VERSION, + .minorVersion = SERVER_RENDER_MINOR_VERSION + }; REQUEST(xRenderQueryVersionReq); @@ -283,12 +289,6 @@ ProcRenderQueryVersion (ClientPtr client) pRenderClient->major_version = stuff->majorVersion; pRenderClient->minor_version = stuff->minorVersion; - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_RENDER_MAJOR_VERSION; - rep.minorVersion = SERVER_RENDER_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -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); |