gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Dec 10 23:25:07 EST 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/ffb30690 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/902f108b (commit)
	from  https://github.com/Gnucash/gnucash/commit/6c216877 (commit)



commit ffb3069044636bad095bcb143d60ca2ecd8e250a
Merge: 6c2168772b 902f108b81
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Dec 10 20:24:41 2024 -0800

    Merge John Ralls's 'bug799420' into stable


commit 902f108b8108542ff6f6bf96f0e3931e7ef36dce
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Dec 10 11:52:42 2024 -0800

    Bug 799420 - gnucash 5.8 crashes on windows 10 while importing qif
    
    xaccTransCommitEdit will delete the transaction if there aren't at
    least 2 splits and that will cause a UAF in xaccTransRecordPrice
    so test the splits before creating the gnc-transaction.

diff --git a/gnucash/import-export/qif-imp/qif-to-gnc.scm b/gnucash/import-export/qif-imp/qif-to-gnc.scm
index 690fee02dd..899f8b9f9b 100644
--- a/gnucash/import-export/qif-imp/qif-to-gnc.scm
+++ b/gnucash/import-export/qif-imp/qif-to-gnc.scm
@@ -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))))
@@ -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)
 



Summary of changes:
 gnucash/import-export/qif-imp/qif-to-gnc.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list