]> spindle.queued.net Git - midori/commitdiff
Use the correct counter when storing adblock filters
authorChristian Dywan <christian@twotoasts.de>
Wed, 14 Oct 2009 01:17:23 +0000 (03:17 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 14 Oct 2009 01:17:23 +0000 (03:17 +0200)
This crash was tricky since 'length' looked correct while in fact
it is the number of items including invalid items, which can be
more than we store.

extensions/adblock.c

index 5ffc3c5c12b53ec3366356feb44ac134cc228616..9cf7931e9339731478d8361ccd25beafbc4ac0fd 100644 (file)
@@ -172,8 +172,8 @@ adblock_preferences_model_row_changed_cb (GtkTreeModel*    model,
                 g_free (filter);
         }
         while (gtk_tree_model_iter_next (model, iter));
-    filters[length] = NULL;
-    midori_extension_set_string_list (extension, "filters", filters, length);
+    filters[i] = NULL;
+    midori_extension_set_string_list (extension, "filters", filters, i);
     g_free (filters);
     if (need_reload)
         adblock_reload_rules (extension);