summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-11-09 06:02:09 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2019-11-09 06:02:09 -0500
commitffc91271de153053c5c070fb11b4c701339ea06d (patch)
tree59f68f9371717bcabf96a10464124ea601e533d5 /src
parent5964fb7e3a3c43db34e8a85df3332da0117e3336 (diff)
issue 12 - DISPLAY=:0.-1 XtScreenDatabase segfault
Add a null-pointer check XtScreenDatabase(), exit if no display was opened. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-rw-r--r--src/Initialize.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Initialize.c b/src/Initialize.c
index 13c5b2f..8ae54b4 100644
--- a/src/Initialize.c
+++ b/src/Initialize.c
@@ -542,6 +542,12 @@ XtScreenDatabase(Screen *screen)
Display *dpy = DisplayOfScreen(screen);
DPY_TO_APPCON(dpy);
+ if (dpy == NULL) {
+ XtErrorMsg("nullDisplay",
+ "XtScreenDatabase", XtCXtToolkitError,
+ "XtScreenDatabase requires a non-NULL display",
+ NULL, NULL);
+ }
LOCK_APP(app);
LOCK_PROCESS;