Skip to content

Commit

Permalink
Merge John Ralls's 'bug799420' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Dec 11, 2024
2 parents 6c21687 + 902f108 commit ffb3069
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gnucash/import-export/qif-imp/qif-to-gnc.scm
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,11 @@
;; Update the progress.
(update-progress)

(if (not (qif-xtn:mark xtn))
;; xaccTransCommitEdit will delete the transaction if
;; there aren't at least 2 splits and that will cause a
;; UAF in xaccTransRecordPrice. See https://bugs.gnucash.org/show_bug.cgi?id=799420
(let ((splits (qif-xtn:splits xtn)))
(if (not (or (qif-xtn:mark xtn) (or (null? splits) (null? (cdr splits)))))
;; Convert into a GnuCash transaction.
(let ((gnc-xtn (xaccMallocTransaction
(gnc-get-current-book))))
Expand All @@ -451,7 +455,8 @@

;; rebalance and commit everything
(xaccTransCommitEdit gnc-xtn)
(xaccTransRecordPrice gnc-xtn PRICE-SOURCE-SPLIT-IMPORT))))
(format #t "transaction splits ~s~%" (qif-xtn:splits xtn))
(xaccTransRecordPrice gnc-xtn PRICE-SOURCE-SPLIT-IMPORT)))))
(qif-file:xtns qif-file)))
sorted-qif-files-list)

Expand Down

0 comments on commit ffb3069

Please sign in to comment.