xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 26 04:02:23 UTC 2024


 hw/xnest/Cursor.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8d5584558ff91c2d50a75f50d80418d2a807a507
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Wed Jul 31 15:11:27 2024 +0200

    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 <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1652>

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);


More information about the xorg-commit mailing list