gstrfuncs: Add missing preconditions to g_str_match_string()
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 28 Nov 2013 20:39:56 +0000 (20:39 +0000)
committerPhilip Withnall <philip@tecnocode.co.uk>
Sun, 4 May 2014 17:21:20 +0000 (18:21 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=113075

glib/gstrfuncs.c

index 0c50dfb..1292266 100644 (file)
@@ -2944,6 +2944,8 @@ g_str_tokenize_and_fold (const gchar   *string,
 {
   gchar **result;
 
+  g_return_val_if_fail (string != NULL, NULL);
+
   if (ascii_alternates && g_str_is_ascii (string))
     {
       *ascii_alternates = g_new0 (gchar *, 0 + 1);
@@ -3037,6 +3039,9 @@ g_str_match_string (const gchar *search_term,
   gboolean matched;
   gint i, j;
 
+  g_return_val_if_fail (search_term != NULL, FALSE);
+  g_return_val_if_fail (potential_hit != NULL, FALSE);
+
   term_tokens = g_str_tokenize_and_fold (search_term, NULL, NULL);
   hit_tokens = g_str_tokenize_and_fold (potential_hit, NULL, accept_alternates ? &alternates : NULL);