mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
glx: avoid null dereference in validGlxFBConfigForWindow()
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 <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2160>
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
1f6966673a
commit
083f55fc1d
@@ -133,7 +133,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;
|
||||
|
||||
Reference in New Issue
Block a user