gnucash maint: Import Matcher: Fix nullptr hash index crash.

John Ralls jralls at code.gnucash.org
Mon Aug 22 12:57:08 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/f412d910 (commit)
	from  https://github.com/Gnucash/gnucash/commit/2c5a5a04 (commit)



commit f412d9109565f123981865d8a296522ffa7b3cc7
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Aug 22 09:56:21 2022 -0700

    Import Matcher: Fix nullptr hash index crash.

diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 2b6cb667a..9c785bb38 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -1027,7 +1027,7 @@ setup_entry (GtkWidget *entry, gboolean sensitive, GHashTable *hash,
 
     list = gtk_list_store_new (NUM_COMPLETION_COLS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
     g_hash_table_foreach (hash, (GHFunc)populate_list, list);
-    if (!g_hash_table_lookup (hash, (gpointer)initial))
+    if (initial && !g_hash_table_lookup (hash, (gpointer)initial))
         populate_list ((gpointer)initial, NULL, list);
     gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list),
                                           COMPLETION_LIST_ORIGINAL,



Summary of changes:
 gnucash/import-export/import-main-matcher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list