Skip to content

Commit

Permalink
Fix null pointer dereference in gnc_split_register_save_to_copy_buffer()
Browse files Browse the repository at this point in the history
If the "transfer" cell has been changed while cutting or copying a split
then it'll dereference the NULL "ft" value.

Check that "ft" is not NULL. This is equivalent to the original behaviour
before cb273b1 when the number of splits
would have been determined to be 0 for the SCM_UNDEFINED value of
"trans_scm".
  • Loading branch information
nomis committed Jun 24, 2023
1 parent 57ca135 commit 1e1e922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnucash/register/ledger-core/split-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ gnc_split_register_save_to_copy_buffer (SplitRegister *reg,

if (!other_fs)
{
if (g_list_length (ft->m_splits) == 1)
if (ft && g_list_length (ft->m_splits) == 1)
{
Split* temp_split;

Expand Down

0 comments on commit 1e1e922

Please sign in to comment.