From fb64e8c018f7d78f5e8945a755a7c8b58950afed Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Fri, 7 Aug 2020 23:41:52 +0200 Subject: ql: Default initialize threads to NULL. The function notmuch_query_search_threads() only sets the pointer on success. Not initializing the pointer could result in an abort or segfault inside notmuch_threads_destroy() due to it pointing to whatever was previously on the stack. --- src/modes/thread_index/query_loader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modes/thread_index/query_loader.cc b/src/modes/thread_index/query_loader.cc index 40f384b..39c2fb8 100644 --- a/src/modes/thread_index/query_loader.cc +++ b/src/modes/thread_index/query_loader.cc @@ -123,7 +123,7 @@ namespace Astroid { if (!in_destructor) stats_ready.emit (); /* set up query */ - notmuch_threads_t * threads; + notmuch_threads_t * threads = NULL; notmuch_query_t * nmquery = notmuch_query_create (db.nm_db, query.c_str ()); for (ustring & t : db.excluded_tags) { -- cgit v1.2.3