xorg-x11-server/0013-Xext-xtest-avoid-null-dereference-in-ProcXTestFakeIn.patch
2026-06-16 11:32:29 +02:00

55 lines
2.2 KiB
Diff
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 3612d6af9cb75895137e89302b633e730171a4d6 Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat, 4 Oct 2025 17:38:32 -0700
Subject: [PATCH xserver 13/51] Xext/xtest: avoid null dereference in
ProcXTestFakeInput()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reported in #1817:
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:383:14: warning[-Wanalyzer-null-dereference]: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:348:9: release_memory: dev is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:383:14: danger: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:395:14: warning[-Wanalyzer-null-dereference]: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:348:9: release_memory: dev is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:395:14: danger: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:426:14: warning[-Wanalyzer-null-dereference]: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext
/xtest.c:348:9: release_memory: dev is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:426:14: danger: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:440:9: warning[-Wanalyzer-null-dereference]: dereference of NULL dev
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:348:9: release_memory: dev is NULL
xwayland-24.1.6/redhat-linux-build/../Xext/xtest.c:440:9: danger: dereference of NULL dev
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 04ef51dae63dc9ef3d28f7d0b78b4504dbb01f66)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2077>
---
Xext/xtest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 3b66224be..fe3a868a4 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -318,6 +318,10 @@ ProcXTestFakeInput(ClientPtr client)
return BadAccess;
dev = GetXTestDevice(dev);
+
+ /* This can only happen if we passed a slave to GetXTestDevice() */
+ if (!dev)
+ return BadAccess;
}
--
2.54.0