From a5d503071b4e60d6158465c71b3da78101b03060 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Fri, 3 Feb 2023 15:27:14 -0800 Subject: [PATCH] Bug 798739 - Advanced Portfolio report fails If the retrieved type is too big it over-runs the avi.include_type array and corrupts the next node's next pointer. --- gnucash/gnome-utils/gnc-option-gtk-ui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp index 763a372f07..d239b34bde 100644 --- a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp +++ b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp @@ -948,7 +948,8 @@ create_account_widget(GncOption& option, char *name) for (node = acct_type_list; node; node = node->next) { GNCAccountType type = static_cast(GPOINTER_TO_INT (node->data)); - avi.include_type[type] = TRUE; + if (type < NUM_ACCOUNT_TYPES) + avi.include_type[type] = TRUE; } gnc_tree_view_account_set_view_info (GNC_TREE_VIEW_ACCOUNT (tree), &avi);