[gtk+] GtkCssProvider: don't segfault when CSS file is not found



commit d462f86aad94a3c5fbd9377a6ea57f731f4d0c0b
Author: Stef Walter <stefw collabora co uk>
Date:   Tue Nov 22 08:13:04 2011 +0100

    GtkCssProvider: don't segfault when CSS file is not found
    
     * Fix null dereference in gtk_css_provider_take_error()
     * And another in gtk_css_provider_emit_error()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664537

 gtk/gtkcssprovider.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 1b993ec..1ac52bc 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1230,7 +1230,7 @@ gtk_css_provider_emit_error (GtkCssProvider *provider,
                              const GError   *error)
 {
   g_signal_emit (provider, css_provider_signals[PARSING_ERROR], 0,
-                 scanner->section, error);
+                 scanner != NULL ? scanner->section : NULL, error);
 }
 
 static void
@@ -1542,7 +1542,7 @@ gtk_css_provider_take_error (GtkCssProvider *provider,
                              GtkCssScanner  *scanner,
                              GError         *error)
 {
-  gtk_css_provider_emit_error (scanner->provider,
+  gtk_css_provider_emit_error (provider,
                                scanner,
                                error);
 



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