Skip to content

Commit

Permalink
Add missing null pointer check in gnc_account_renumber_update_examples()
Browse files Browse the repository at this point in the history
gtk_entry_get_text() should never return null but "prefix" is checked for
null on the first string and then dereferenced unconditionally on the
second string. Change this to be consistent and check twice.
  • Loading branch information
nomis committed Jun 24, 2023
1 parent ab6c637 commit dff96b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/dialog-account.c
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@ gnc_account_renumber_update_examples (RenumberDialog *data)
gtk_label_set_text (GTK_LABEL(data->example1), str);
g_free (str);

if (strlen (prefix))
if (prefix && *prefix)
str = g_strdup_printf ("%s-%0*d", prefix, num_digits,
interval * data->num_children);
else
Expand Down

0 comments on commit dff96b2

Please sign in to comment.