[gtk+] gtkicontheme: check if the context quark string is not null



commit a12b691b76c6b1f77be5a152211ee83de6fe104b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Oct 17 13:02:26 2016 +0200

    gtkicontheme: check if the context quark string is not null
    
    On windows you might not have a theme installed by default which
    means that when trying to create the context quark it will fail.
    If then we try to replace a NULL key in the hash table it will crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769859

 gtk/gtkicontheme.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index a2255d4..e31c75a 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3179,7 +3179,8 @@ theme_list_contexts (IconTheme  *theme,
       dir = l->data;
 
       context = g_quark_to_string (dir->context);
-      g_hash_table_replace (contexts, (gpointer) context, NULL);
+      if (context != NULL)
+        g_hash_table_replace (contexts, (gpointer) context, NULL);
 
       l = l->next;
     }


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