Blame SOURCES/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch

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