From d0b170fd7c5e2f5a3b5c69a7e936713e637c07ea Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 1 Apr 2024 10:09:20 +0800 Subject: [PATCH] [dialog-bi-import.c] insert "" in ListStore when regex match fails because the liststore data isn't being null-checked. It's easier to insert "" when the regex match fails thereby allowing strlen e.g. strlen(date_posted) to return 0 instead of segfaulting. --- gnucash/import-export/bi-import/dialog-bi-import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnucash/import-export/bi-import/dialog-bi-import.c b/gnucash/import-export/bi-import/dialog-bi-import.c index 3c3f55bec1..5a382028ba 100644 --- a/gnucash/import-export/bi-import/dialog-bi-import.c +++ b/gnucash/import-export/bi-import/dialog-bi-import.c @@ -68,7 +68,7 @@ g_strstrip( temp ); \ gtk_list_store_set (store, &iter, column, temp, -1); \ g_free (temp); \ - } + } else gtk_list_store_set (store, &iter, column, "", -1); static QofLogModule log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS; static char * un_escape(char *str);