From 8d5584558ff91c2d50a75f50d80418d2a807a507 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 31 Jul 2024 15:11:27 +0200 Subject: [PATCH] Xnest: cursor: fix potentially uninitialized memory It's safer to zero-out the cursor-private memory on allocation, instead of relying on being cleared initialized somewhere later. Fixes: 3f3ff971ec - Replace X-allocation functions with their C89 counterparts Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- hw/xnest/Cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index fea5a959b..22999bfaa 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -99,7 +99,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) bg_color.green = pCursor->backGreen; bg_color.blue = pCursor->backBlue; - xnestSetCursorPriv(pCursor, pScreen, malloc(sizeof(xnestPrivCursor))); + xnestSetCursorPriv(pCursor, pScreen, calloc(1, sizeof(xnestPrivCursor))); xnestCursor(pCursor, pScreen) = XCreatePixmapCursor(xnestDisplay, source, mask, &fg_color, &bg_color, pCursor->bits->xhot, pCursor->bits->yhot);