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

Olivier Fourdan noreply at xfce.org
Tue Feb 23 21:40:03 CET 2010


Updating branch refs/heads/master
         to 62b44d6241a2a88a32b26e0908b350971892ce3a (commit)
       from 45fd45d4e04a50a161d6e1fdd74ae3851fea7c10 (commit)

commit 62b44d6241a2a88a32b26e0908b350971892ce3a
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 b857671..2643fc9 100644
--- a/settings-dialogs/xfwm4-settings.c
+++ b/settings-dialogs/xfwm4-settings.c
@@ -1470,6 +1470,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));
 
@@ -1482,7 +1483,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