From 0bd9955f4e76d248f989d2385031267f80052bbe Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 29 Mar 2026 12:39:53 -0700 Subject: [PATCH] [PR #2179] glx: avoid null dereference in validGlxFBConfigForWindow() PR: https://github.com/X11Libre/xserver/pull/2179 --- glx/glxcmds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 4c2186a4b..964d26f04 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -127,7 +127,8 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config, BUG_RETURN_VAL(!pVisual, FALSE); /* 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;