Blame SOURCES/xorg-x11-server-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch

ddb7d4
From 7150ba655c0cc08fa6ded309b81265bb672f2869 Mon Sep 17 00:00:00 2001
ddb7d4
From: Peter Hutterer <peter.hutterer@who-t.net>
ddb7d4
Date: Wed, 25 Jan 2023 11:41:40 +1000
ddb7d4
Subject: [PATCH xserver] Xi: fix potential use-after-free in
ddb7d4
 DeepCopyPointerClasses
ddb7d4
ddb7d4
CVE-2023-0494, ZDI-CAN 19596
ddb7d4
ddb7d4
This vulnerability was discovered by:
ddb7d4
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
ddb7d4
ddb7d4
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
ddb7d4
---
ddb7d4
 Xi/exevents.c | 4 +++-
ddb7d4
 1 file changed, 3 insertions(+), 1 deletion(-)
ddb7d4
ddb7d4
diff --git a/Xi/exevents.c b/Xi/exevents.c
ddb7d4
index 217baa9561..dcd4efb3bc 100644
ddb7d4
--- a/Xi/exevents.c
ddb7d4
+++ b/Xi/exevents.c
ddb7d4
@@ -619,8 +619,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
ddb7d4
             memcpy(to->button->xkb_acts, from->button->xkb_acts,
ddb7d4
                    sizeof(XkbAction));
ddb7d4
         }
ddb7d4
-        else
ddb7d4
+        else {
ddb7d4
             free(to->button->xkb_acts);
ddb7d4
+            to->button->xkb_acts = NULL;
ddb7d4
+        }
ddb7d4
 
ddb7d4
         memcpy(to->button->labels, from->button->labels,
ddb7d4
                from->button->numButtons * sizeof(Atom));
ddb7d4
-- 
ddb7d4
2.39.0
ddb7d4