xserver: Branch 'server-21.1-branch'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Sep 1 17:29:27 UTC 2024


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

New commits:
commit b08cb8141b544788d8607fa31e69c089acdb4fa4
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
    Backport-Of: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1652
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1653>

diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c
index 285e10ebf..652abd21e 100644
--- a/hw/xnest/Cursor.c
+++ b/hw/xnest/Cursor.c
@@ -98,7 +98,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