Author: jasper
Date: 2007-02-18 20:06:58 +0000 (Sun, 18 Feb 2007)
New Revision: 24991

Modified:
   xfce4-panel/trunk/panel/panel-config.c
   xfce4-panel/trunk/panel/panel-item-manager.c
Log:
Check for NULL pointers in DBG messages to prevent crashes on Solaris, based on 
patch from William Bonnet (bug #2922).

Modified: xfce4-panel/trunk/panel/panel-config.c
===================================================================
--- xfce4-panel/trunk/panel/panel-config.c      2007-02-18 12:05:45 UTC (rev 
24990)
+++ xfce4-panel/trunk/panel/panel-config.c      2007-02-18 20:06:58 UTC (rev 
24991)
@@ -360,7 +360,7 @@
                     ++i;
                 }
 
-                if (name != NULL)
+                if (name != NULL && value != NULL)
                 {
                     DBG ("Add item: name=\"%s\", id=\"%s\"", name, value);
 

Modified: xfce4-panel/trunk/panel/panel-item-manager.c
===================================================================
--- xfce4-panel/trunk/panel/panel-item-manager.c        2007-02-18 12:05:45 UTC 
(rev 24990)
+++ xfce4-panel/trunk/panel/panel-item-manager.c        2007-02-18 20:06:58 UTC 
(rev 24991)
@@ -297,6 +297,13 @@
     else
     {
         dirs = xfce_resource_dirs (XFCE_RESOURCE_DATA);
+
+        if (G_UNLIKELY(!dirs))
+        {
+            dirs    = g_new (char*, 2);
+            dirs[0] = g_strdup (DATADIR);
+            dirs[1] = NULL;
+        }
     }
     
     for (d = dirs; *d != NULL || !datadir_used; ++d)
@@ -343,9 +350,12 @@
                 {
                     DBG (" + class \"%s\": "
                          "name=%s, comment=%s, icon=%s, external=%d, path=%s", 
-                         class->plugin_name,
-                         class->name, class->comment, class->icon,
-                         class->is_external, class->file);
+                         class->plugin_name ? class->plugin_name : "(null)",
+                         class->name        ? class->name        : "(null)", 
+                         class->comment     ? class->comment     : "(null)", 
+                         class->icon        ? class->icon        : "(null)",
+                         class->is_external, 
+                         class->file        ? class->file        : "(null)");
                 
                     g_hash_table_insert (plugin_classes, 
                                          class->plugin_name, 

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to