From fa030cbaca7dc8a0a891cd1be7578652d20fbf45 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 14 Oct 2009 03:17:23 +0200 Subject: [PATCH] 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. --- extensions/adblock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index 5ffc3c5c..9cf7931e 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -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); -- 2.39.5