tags 715917 patch thanks Running freesci with no X or with an empty environment 'env -i /usr/games/freesci' results in a segfault. The attached patch avoids calling XGetVisualInfo() if display is NULL.
Description: fix segfault with no X Running freesci with no X or with an empty environment 'env -i /usr/games/freesci' results in a segfault. This patch avoids calling XGetVisualInfo() if display is NULL. Bug-Debian: http://bugs.debian.org/715917 Author: Graham Inggs <gra...@nerve.org.za> Forwarded: No Last-Update: 2013-11-08 --- freesci-0.6.4/src/gfx/drivers/xlib_driver.c +++ freesci-0.6.4/src/gfx/drivers/xlib_driver.c @@ -668,6 +668,12 @@ "PseudoColor", "TrueColor", "DirectColor"};
printf("Visuals provided by X11 server:\n"); + + if (!display) { + printf(" None!\n"); + return; + } + visuals = XGetVisualInfo(display, VisualNoMask, &foo, &visuals_nr); if (!visuals_nr) {