metacity r4003 - in trunk: . src/core src/ui



Author: tthurman
Date: Mon Oct 27 11:52:47 2008
New Revision: 4003
URL: http://svn.gnome.org/viewvc/metacity?rev=4003&view=rev

Log:
2008-10-27  Brian Cameron  <brian cameron sun com>

        Fix some crashes with the new GDM 2.24.  Closes #558058.

        * src/ui/ui.c (meta_ui_parse_modifier): another null check
        * src/core/prefs.c (titlebar_handler, button_layout_handler):
          more null checks.



Modified:
   trunk/ChangeLog
   trunk/src/core/prefs.c
   trunk/src/ui/ui.c

Modified: trunk/src/core/prefs.c
==============================================================================
--- trunk/src/core/prefs.c	(original)
+++ trunk/src/core/prefs.c	Mon Oct 27 11:52:47 2008
@@ -1326,13 +1326,14 @@
 {
   PangoFontDescription *new_desc;
 
-  new_desc = pango_font_description_from_string (string_value);
+  if (string_value)
+    new_desc = pango_font_description_from_string (string_value);
 
   if (new_desc == NULL)
     {
       meta_warning (_("Could not parse font description "
                       "\"%s\" from GConf key %s\n"),
-                    string_value,
+                    string_value ? string_value : "(null)",
                     KEY_TITLEBAR_FONT);
 
       *inform_listeners = FALSE;
@@ -1476,16 +1477,17 @@
                          gboolean *inform_listeners)
 {
   MetaButtonLayout new_layout;
-  char **sides;
+  char **sides = NULL;
   int i;
   
   /* We need to ignore unknown button functions, for
    * compat with future versions
    */
   
-  sides = g_strsplit (string_value, ":", 2);
+  if (string_value)
+    sides = g_strsplit (string_value, ":", 2);
 
-  if (sides[0] != NULL)
+  if (sides != NULL && sides[0] != NULL)
     {
       char **buttons;
       int b;
@@ -1545,7 +1547,7 @@
       g_strfreev (buttons);
     }
 
-  if (sides[0] != NULL && sides[1] != NULL)
+  if (sides != NULL && sides[0] != NULL && sides[1] != NULL)
     {
       char **buttons;
       int b;

Modified: trunk/src/ui/ui.c
==============================================================================
--- trunk/src/ui/ui.c	(original)
+++ trunk/src/ui/ui.c	Mon Oct 27 11:52:47 2008
@@ -850,7 +850,7 @@
   
   *mask = 0;
 
-  if (strcmp (accel, "disabled") == 0)
+  if (accel == NULL || strcmp (accel, "disabled") == 0)
     return TRUE;
   
   meta_ui_accelerator_parse (accel, &gdk_sym, &gdk_code, &gdk_mask);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]