XOpenDisplay: ensure each screen has a valid root_visual pointer

Other code assumes this pointer cannot be NULL, so fail the connection
if a bug has caused the X server to give a non-existent visual ID for
the default visual of any screen.

Reported-by: Gregory James DUCK <gjduck@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Alan Coopersmith 2023-09-17 10:11:02 -07:00
parent 3962080b78
commit 78b37accff

View file

@ -473,6 +473,10 @@ XOpenDisplay (
}
}
sp->root_visual = _XVIDtoVisual(dpy, root_visualID);
if (sp->root_visual == NULL) {
OutOfMemory(dpy);
return(NULL);
}
}
if(usedbytes != setuplength){