diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-09-17 10:11:02 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-09-17 10:11:02 -0700 |
commit | 78b37accff1abbe713349d59fdefd963ffa04bbc (patch) | |
tree | 94a00596dcb1b96230a3ae2a6bd59092c1113618 | |
parent | 3962080b7846d79fd3cf10b16eddacf68eb321b7 (diff) |
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>
-rw-r--r-- | src/OpenDis.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/OpenDis.c b/src/OpenDis.c index 7c8d4e1a..89a0ebdf 100644 --- a/src/OpenDis.c +++ b/src/OpenDis.c @@ -473,6 +473,10 @@ XOpenDisplay ( } } sp->root_visual = _XVIDtoVisual(dpy, root_visualID); + if (sp->root_visual == NULL) { + OutOfMemory(dpy); + return(NULL); + } } if(usedbytes != setuplength){ |