diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:42 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:58:29 -0700 |
commit | cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e (patch) | |
tree | ebc4c13ebd7471cbfa7425c190303793ea5b7ff9 /Xext | |
parent | ef0f701c9245b0373eb0c7a84dd804af4738bb29 (diff) |
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>
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/sync.c | 2 | ||||
-rw-r--r-- | Xext/xf86bigfont.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Xext/sync.c b/Xext/sync.c index 6dc4c5e76..fc712cd2e 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -475,7 +475,7 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait, if (client->clientGone) return; - pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent)); + pev = pEvents = calloc(num_events, sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 3a1e1b288..a90286135 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -554,7 +554,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) ? nUniqCharInfos * sizeof(xCharInfo) + (nCharInfos + 1) / 2 * 2 * sizeof(CARD16) : 0); - xXF86BigfontQueryFontReply *reply = malloc(rlength); + xXF86BigfontQueryFontReply *reply = calloc(1, rlength); char *p; if (!reply) { |