Use the correct counter when storing adblock filters

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.
This commit is contained in:
Christian Dywan 2009-10-14 03:17:23 +02:00
parent 5f30199df5
commit fa030cbaca

View file

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