[gnome-control-center] common: Fix crash in language chooser



commit e85816f83b09e1c821ba12b343860a32c2851299
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Mar 26 12:14:03 2019 +1300

    common: Fix crash in language chooser
    
    A report in Red Hat bugzilla [1] shows for some reason the country is set to
    NULL and this causes a crash when comparing against search terms. The solution
    is to handle the NULL without crashing.
    
    [1] https://bugzilla.redhat.com/show_bug.cgi?id=1685251

 panels/common/cc-language-chooser.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index ae6391a78..1c15b4333 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -188,6 +188,9 @@ match_all (gchar       **words,
 {
         gchar **w;
 
+        if (str == NULL)
+                return FALSE;
+
         for (w = words; *w; ++w)
                 if (!strstr (str, *w))
                         return FALSE;


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