Skip to content

Commit

Permalink
fix segfault crash when DISPLAY is empty (getenv returned null pointer)
Browse files Browse the repository at this point in the history
  • Loading branch information
donbright committed Sep 3, 2016
1 parent 77782d2 commit 6717048
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OffscreenContextGLX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ bool create_glx_dummy_window(OffscreenContext &ctx)

ctx.xdisplay = XOpenDisplay(NULL);
if (ctx.xdisplay == NULL) {
cerr << "Unable to open a connection to the X server (DISPLAY=" << getenv("DISPLAY") << ")\n";
cerr << "Unable to open a connection to the X server.\n";
char * dpyenv = getenv("DISPLAY");
cerr << "DISPLAY=" << (dpyenv?dpyenv:"") << "\n";
return false;
}

Expand Down

0 comments on commit 6717048

Please sign in to comment.