Skip to content

Commit 0d6d9a4

Browse files
alancmetux
authored andcommitted
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>
1 parent 9649dad commit 0d6d9a4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

glx/glxcmds.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config,
133133
BUG_RETURN_VAL(!pVisual, FALSE);
134134

135135
/* FIXME: What exactly should we check here... */
136-
if (pVisual->class != glxConvertToXVisualType(config->visualType) ||
136+
if (pVisual == NULL ||
137+
pVisual->class != glxConvertToXVisualType(config->visualType) ||
137138
!(config->drawableType & GLX_WINDOW_BIT)) {
138139
client->errorValue = pDraw->id;
139140
*err = BadMatch;

0 commit comments

Comments
 (0)