XOpenDisplay segfaults if passed invalid display name
The following simple test case always segfaults:
#include <X11/Xlib.h>
int main(void) {
XOpenDisplay("this is invalid");
return 0;
}
Backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7cd80a6 in pthread_cond_destroy@@GLIBC_2.3.2 () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007ffff7cd80a6 in pthread_cond_destroy@@GLIBC_2.3.2 () from /usr/lib/libc.so.6
#1 0x00007ffff7e97b1f in _XFreeX11XCBStructure () from /usr/lib/libX11.so.6
#2 0x00007ffff7e8745f in _XFreeDisplayStructure () from /usr/lib/libX11.so.6
#3 0x00007ffff7e87e82 in XOpenDisplay () from /usr/lib/libX11.so.6
#4 0x000055555555514c in main ()
Environment:
- Arch Linux (x86_64)
- libx11 1.7.4-1