From 1c614d49daccff692069150e7ad96efb40017873 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 29 Mar 2026 12:39:53 -0700 Subject: [PATCH] glx: avoid null dereference in validGlxFBConfigForWindow() 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/../glx/glxcmds.c:126:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pVisual’ Signed-off-by: Alan Coopersmith --- glx/glxcmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 8df68e6d7..148a4075d 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -123,7 +123,8 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config, } /* FIXME: What exactly should we check here... */ - if (pVisual->class != glxConvertToXVisualType(config->visualType) || + if (pVisual == NULL || + pVisual->class != glxConvertToXVisualType(config->visualType) || !(config->drawableType & GLX_WINDOW_BIT)) { client->errorValue = pDraw->id; *err = BadMatch;