[Xfce4-commits] <xfwm4:xfce-4.6> Check for invalid type for GValue to avoid a crash (bug #6195)

Olivier Fourdan noreply at xfce.org
Tue Feb 23 21:42:01 CET 2010


Updating branch refs/heads/xfce-4.6
         to bc9e8203b9438dc0066e622d79526e7e854b95cf (commit)
       from 957bded4722d5e8f593992ac557af1b7da393839 (commit)

commit bc9e8203b9438dc0066e622d79526e7e854b95cf
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Feb 23 21:38:34 2010 +0100

    Check for invalid type for GValue to avoid a crash (bug #6195)

 settings-dialogs/xfwm4-settings.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c
index f8a0ca4..efbecad 100644
--- a/settings-dialogs/xfwm4-settings.c
+++ b/settings-dialogs/xfwm4-settings.c
@@ -1468,6 +1468,7 @@ xfwm_settings_title_alignment_property_changed (XfconfChannel *channel,
   GtkTreeIter   iter;
   GtkWidget    *combo;
   gchar        *alignment;
+  const gchar  *new_value;
 
   g_return_if_fail (XFWM_IS_SETTINGS (settings));
 
@@ -1480,7 +1481,12 @@ xfwm_settings_title_alignment_property_changed (XfconfChannel *channel,
         {
           gtk_tree_model_get (model, &iter, 1, &alignment, -1);
 
-          if (G_UNLIKELY (g_str_equal (alignment, g_value_get_string (value))))
+          if (G_UNLIKELY (G_VALUE_TYPE (value) == G_TYPE_INVALID))
+              new_value = "center";
+          else
+              new_value = g_value_get_string (value);
+
+          if (G_UNLIKELY (g_str_equal (alignment, new_value)))
             {
               g_free (alignment);
               gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &iter);



More information about the Xfce4-commits mailing list