From 7ffd763439990f18f2045e6bb1f0937085ef6e6c Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sun, 15 Mar 2026 13:36:52 +0200 Subject: [PATCH] xf86: check return value of XF86_CRTC_CONFIG_PTR in xf86CompatOutput() If privates[xf86CrtcConfigPrivateIndex].ptr is NULL, this will cause a segfault. Possible fix for https://gitlab.freedesktop.org/xorg/xserver/-/issues/1241 Signed-off-by: Benjamin Valentin Part-of: --- include/xf86Crtc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xf86Crtc.h b/include/xf86Crtc.h index 1eeda5665d..bacafa6252 100644 --- a/include/xf86Crtc.h +++ b/include/xf86Crtc.h @@ -842,7 +842,7 @@ xf86CompatOutput(ScrnInfoPtr pScrn) if (xf86CrtcConfigPrivateIndex == -1) return NULL; config = XF86_CRTC_CONFIG_PTR(pScrn); - if (config->compat_output < 0) + if ((config == NULL) || (config->compat_output < 0)) return NULL; return config->output[config->compat_output]; }