[gnome-builder] words: fix potential use-after free
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] words: fix potential use-after free
- Date: Tue, 26 Jun 2018 21:39:42 +0000 (UTC)
commit 7ab4029a23b9c970d08a0d7b39648e27083f07bd
Author: Christian Hergert <chergert redhat com>
Date: Tue Jun 26 14:38:47 2018 -0700
words: fix potential use-after free
src/plugins/words/gbp-word-proposals.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/words/gbp-word-proposals.c b/src/plugins/words/gbp-word-proposals.c
index 64bb14484..29cd8af40 100644
--- a/src/plugins/words/gbp-word-proposals.c
+++ b/src/plugins/words/gbp-word-proposals.c
@@ -100,6 +100,7 @@ gbp_word_proposals_finalize (GObject *object)
dzl_clear_pointer (&self->unfiltered, g_ptr_array_unref);
dzl_clear_pointer (&self->items, g_array_unref);
+ dzl_clear_pointer (&self->words_dedup, g_hash_table_unref);
dzl_clear_pointer (&self->words, g_string_chunk_free);
dzl_clear_pointer (&self->last_word, g_free);
@@ -253,6 +254,7 @@ gbp_word_proposals_populate_async (GbpWordProposals *self,
g_array_remove_range (self->items, 0, old_len);
if (self->unfiltered->len > 0)
g_ptr_array_remove_range (self->unfiltered, 0, self->unfiltered->len);
+ g_hash_table_remove_all (self->words_dedup);
g_string_chunk_clear (self->words);
g_list_model_items_changed (G_LIST_MODEL (self), 0, old_len, 0);
}
@@ -401,8 +403,8 @@ gbp_word_proposals_clear (GbpWordProposals *self)
if (self->unfiltered->len)
g_ptr_array_remove_range (self->unfiltered, 0, self->unfiltered->len);
- g_string_chunk_clear (self->words);
g_hash_table_remove_all (self->words_dedup);
+ g_string_chunk_clear (self->words);
dzl_clear_pointer (&self->last_word, g_free);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]