hsetroot/hsetroot-1.0.2_01_fix-no-display-crash.patch

24 lines
618 B
Diff

Description: Fix a segmentation fault when no display is present.
Origin: vendor
Bug: http://bugs.debian.org/507554
Forwarded: no
Author: <michal.suchanek@ruk.cuni.cz>
Reviewed-by: Alessandro Ghedini <ghedo@debian.org>
Last-Update: 2012-08-05
Applied-Upstream: *** FIXME ***
--- a/src/hsetroot.c
+++ b/src/hsetroot.c
@@ -254,6 +254,11 @@
Imlib_Color_Modifier modifier = NULL;
_display = XOpenDisplay (NULL);
+ if(!_display){
+ fprintf (stderr, "Cannot open X display!\n");
+ exit (123);
+ }
+
for (screen = 0; screen < ScreenCount (_display); screen++)
{
display = XOpenDisplay (NULL);