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/xfixes/cursor.c | |
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/xfixes/cursor.c')
-rw-r--r-- | nx-X11/programs/Xserver/xfixes/cursor.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 152bda500..fc4c1d803 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -201,7 +201,7 @@ XFixesSelectCursorInput (ClientPtr pClient, } if (!e) { - e = (CursorEventPtr) malloc (sizeof (CursorEventRec)); + e = (CursorEventPtr) calloc (1, sizeof (CursorEventRec)); if (!e) return BadAlloc; @@ -364,8 +364,8 @@ ProcXFixesGetCursorImage (ClientPtr client) width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; - rep = malloc (sizeof (xXFixesGetCursorImageReply) + - npixels * sizeof (CARD32)); + rep = calloc (sizeof (xXFixesGetCursorImageReply) + + npixels * sizeof (CARD32), 1); if (!rep) return BadAlloc; @@ -456,11 +456,13 @@ ProcXFixesGetCursorName (ClientPtr client) str = ""; len = strlen (str); - reply.type = X_Reply; - reply.length = (len + 3) >> 2; - reply.sequenceNumber = client->sequence; - reply.atom = pCursor->name; - reply.nbytes = len; + reply = (xXFixesGetCursorNameReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (len + 3) >> 2, + .atom = pCursor->name, + .nbytes = len + }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); @@ -508,8 +510,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) name = pCursor->name ? NameForAtom (pCursor->name) : ""; nbytes = strlen (name); nbytesRound = (nbytes + 3) & ~3; - rep = malloc (sizeof (xXFixesGetCursorImageAndNameReply) + - npixels * sizeof (CARD32) + nbytesRound); + rep = calloc (sizeof (xXFixesGetCursorImageAndNameReply) + + npixels * sizeof (CARD32) + nbytesRound, 1); if (!rep) return BadAlloc; @@ -757,7 +759,7 @@ createCursorHideCount (ClientPtr pClient, ScreenPtr pScreen) CursorScreenPtr cs = GetCursorScreen(pScreen); CursorHideCountPtr pChc; - pChc = (CursorHideCountPtr) malloc(sizeof(CursorHideCountRec)); + pChc = (CursorHideCountPtr) calloc(1, sizeof(CursorHideCountRec)); if (pChc == NULL) { return BadAlloc; } |