[X2Go-Commits] [nx-libs] 04/429: randr: fix broken macros / memory corruption

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:35:59 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit d1a967f3aefcffc6babeb25fccc912c0bfdb9fe3
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Fri Oct 16 18:57:47 2020 +0200

    randr: fix broken macros / memory corruption
    
    By casting the rrScrPriv to ScreenPtr we are using the offsets from
    the Screen structure for referencing data in the rrScrPriv structure
    causing data corruption. As both macros use the same casting this
    still works until the location where the data resides is
    overwritten. For 64bit the location was the "rotations" member in
    rrScrPriv which was not problematic because it is barely used. But on
    32bit it was "numCrtcs" which is heavily used. On unwrap this was 0
    and lead to a segfault.
    
    Fixes ArcticaProject/nx-libs#943
---
 nx-X11/programs/Xserver/randr/randr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nx-X11/programs/Xserver/randr/randr.c b/nx-X11/programs/Xserver/randr/randr.c
index c742cf6e0..f8401a5cd 100644
--- a/nx-X11/programs/Xserver/randr/randr.c
+++ b/nx-X11/programs/Xserver/randr/randr.c
@@ -69,12 +69,12 @@
 static int RRNScreens;
 
 #define wrap(priv,real,mem,func) {\
-    ((ScreenPtr)priv)->mem = ((ScreenPtr)real)->mem; \
-    ((ScreenPtr)real)->mem = func; \
+    priv->mem = real->mem; \
+    real->mem = func; \
 }
 
 #define unwrap(priv,real,mem) {\
-    ((ScreenPtr)real)->mem = ((ScreenPtr)priv)->mem; \
+    real->mem = priv->mem; \
 }
 
 static int ProcRRDispatch(ClientPtr pClient);

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list