rpms/gtk2/devel color-loop.patch,NONE,1.1 gtk2.spec,1.312,1.313

Matthias Clasen mclasen at fedoraproject.org
Mon Aug 25 13:19:56 UTC 2008


Author: mclasen

Update of /cvs/extras/rpms/gtk2/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11701

Modified Files:
	gtk2.spec 
Added Files:
	color-loop.patch 
Log Message:
fix a possible infinite loop in rc file parsing


color-loop.patch:

--- NEW FILE color-loop.patch ---
diff -up gtk+-2.13.7/gtk/gtksettings.c.color-loop gtk+-2.13.7/gtk/gtksettings.c
--- gtk+-2.13.7/gtk/gtksettings.c.color-loop	2008-08-25 09:16:09.000000000 -0400
+++ gtk+-2.13.7/gtk/gtksettings.c	2008-08-25 09:16:21.000000000 -0400
@@ -1892,14 +1892,13 @@ _gtk_settings_handle_event (GdkEventSett
       if (property_id == PROP_COLOR_SCHEME)
         {
           GValue value = { 0, };
-
+ 
           g_value_init (&value, G_TYPE_STRING);
           if (!gdk_screen_get_setting (settings->screen, pspec->name, &value))
             g_value_set_static_string (&value, "");
           merge_color_scheme (settings, &value, GTK_SETTINGS_SOURCE_XSETTING);
           g_value_unset (&value);
         }
-
       g_object_notify (G_OBJECT (settings), pspec->name);
    }
 }
@@ -2258,6 +2257,7 @@ update_color_hash (ColorSchemeData   *da
 {
   gboolean changed = FALSE;
   gint i;
+  GHashTable *old_hash;
 
   if ((str == NULL || *str == '\0') && 
       (data->lastentry[source] == NULL || data->lastentry[source][0] == '\0'))
@@ -2291,8 +2291,7 @@ update_color_hash (ColorSchemeData   *da
     return FALSE;
     
   /* Rebuild the merged hash table. */
-  if (data->color_hash)
-    g_hash_table_unref (data->color_hash);
+  old_hash = data->color_hash;
   data->color_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
 					    (GDestroyNotify) gdk_color_free);
   for (i = 0; i <= GTK_SETTINGS_SOURCE_APPLICATION; i++)
@@ -2302,7 +2301,35 @@ update_color_hash (ColorSchemeData   *da
 			      data->color_hash);
     }
 
-  return TRUE;
+  if (old_hash)
+    {
+      /* now check if the merged hash has changed */
+      changed = FALSE;
+      if (g_hash_table_size (old_hash) != g_hash_table_size (data->color_hash))
+        changed = TRUE;
+      else
+        {
+          GHashTableIter iter;
+          gpointer key, value, new_value;
+
+          g_hash_table_iter_init (&iter, old_hash);
+          while (g_hash_table_iter_next (&iter, &key, &value))
+            {
+              new_value = g_hash_table_lookup (data->color_hash, key);
+              if (!new_value || !gdk_color_equal (value, new_value))
+                {
+                  changed = TRUE;
+                  break;
+                } 
+            }
+        }
+
+      g_hash_table_unref (old_hash);
+    }
+  else 
+    changed = TRUE;
+
+  return changed;
 }
 
 static void


Index: gtk2.spec
===================================================================
RCS file: /cvs/extras/rpms/gtk2/devel/gtk2.spec,v
retrieving revision 1.312
retrieving revision 1.313
diff -u -r1.312 -r1.313
--- gtk2.spec	22 Aug 2008 23:01:25 -0000	1.312
+++ gtk2.spec	25 Aug 2008 13:19:25 -0000	1.313
@@ -16,7 +16,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.gnome.org/sources/gtk+/2.13/gtk+-%{version}.tar.bz2
@@ -30,6 +30,8 @@
 # a workaround for some brokenness in the flash plugin
 # see http://bugzilla.gnome.org/show_bug.cgi?id=463773
 Patch2: workaround.patch
+# from upstream svn
+Patch3: color-loop.patch
 
 BuildRequires: atk-devel >= %{atk_version}
 BuildRequires: pango-devel >= %{pango_version}
@@ -115,6 +117,7 @@
 %patch0 -p1 -b .lib64
 %patch1 -p1 -b .set-invisible-char-to-bullet
 %patch2 -p1 -b .workaround
+%patch3 -p1 -b .color-loop
 
 for i in config.guess config.sub ; do
   test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@@ -298,6 +301,9 @@
 %{_datadir}/gtk-2.0
 
 %changelog
+* Mon Aug 25 2008 Matthias Clasen <mclasen at redhat.com> - 2.13.7-2
+- Fix a possible infinite loop in gtkrc parsing
+
 * Fri Aug 22 2008 Matthias Clasen <mclasen at redhat.com> - 2.13.7-1
 - Update to 2.13.7
 




More information about the fedora-extras-commits mailing list