gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Jan 17 20:15:48 EST 2026


Updated	 via  https://github.com/Gnucash/gnucash/commit/e5fe2f3e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/113af562 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7f0d66d4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/be5933a1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0e3853bf (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6e9a20df (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a2cc9881 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9079d873 (commit)
	from  https://github.com/Gnucash/gnucash/commit/cad455e3 (commit)



commit e5fe2f3e0ee3d5a768ef29aae296c3559d626466
Merge: cad455e3c0 113af56272
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jan 17 17:11:27 2026 -0800

    Merge Stefan Koch's 'sk-unittest-qofid' into stable.

commit 113af56272deac7deeb728c9a7caf5ad37190b9a
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Thu Jan 15 13:14:36 2026 -0500

    fixup: Review comments about style of code.

commit 7f0d66d43977816de38b70554ad5555e6ab8fbe2
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Thu Jan 15 13:00:52 2026 -0500

    fixup: Add the new test-qofid.cpp file the the source distribution.

commit be5933a1ec6dfc0c6d0211d62f330872c092d788
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Thu Jan 15 11:52:59 2026 -0500

    fixup:  Remove memory leaks in the test code.

commit 0e3853bfb73cf0edf276ce98ac74523c230b2a38
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Thu Jan 15 07:10:20 2026 -0500

    Fix undefined behaviour in collection_compare_cb function.
    
    The collection_compare_cb function set the user_data pointer to point to a local variable
    of the function.  That pointer is then used in the (only) calling function
    qof_collection_compare to make decisions.  This is undefined.  It is likely not an actual
    problem because the stack depth of the qof_collection_foreach followed by
    collection_compare_cb is deeper than the qof_collection_get_data call (and others
    in between if any) that the stack data user data stays uncorrupted.
    
    But, it is undefined behavior, and could cause really subtle bugs if these there are code
    changes that have deeper stack between the setting and using.
    
    Also, using this local variable is not necessary, the qof_collection_compare function
    already  sets up a variable local to its scope for this that the collection_compare_cb can
    use directly.
    
    This commit removes the local (to collection_compare_cb) variable and uses the one setup
    in qof_collection_compare.
    
    The full coverage test for qofid.cpp passed before and after this change.

commit 6e9a20dfebca6bbba8d9cfdeb6b4183a3d0fe364
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Tue Jan 13 12:30:22 2026 -0500

    Implement full test coverage of libgnucash/engine/qofid
    
    NOTE:  This does not have full coverage because the "if (!target || !ent)" body in the
    collection_compare_cp function cannot be reached. There is too  much safety in the rest of
    the system to test this error.
    
    NOTE: I made this a separate test from the test-engine so that I was able to check that it
    by itself could test the full coverage of the qofid.cpp file. If it was part of the larger
    test, I could have missed some parts that were covered incidentally elsewhere.

commit a2cc9881dfc08ebde84ce0b9a421b9f2d7e5d708
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Thu Jan 15 08:42:20 2026 -0500

    Explicitly set the is_dirty attribute in qof_collection_new
    
    It is likely that the memory was zeroed anyway, but the explicitness makes it easier to read.

commit 9079d87307c3a1b7e7d33c64c8ed30ebe7c29d7c
Author: Stefan Koch <stefan.koch at micromeritics.com>
Date:   Thu Jan 15 08:41:35 2026 -0500

    Remove unused qof_collection_from_glist function.



Summary of changes:
 libgnucash/engine/qofid.cpp           |  36 ++----
 libgnucash/engine/qofid.h             |  13 ---
 libgnucash/engine/test/CMakeLists.txt |   4 +
 libgnucash/engine/test/test-qofid.cpp | 210 ++++++++++++++++++++++++++++++++++
 4 files changed, 221 insertions(+), 42 deletions(-)
 create mode 100644 libgnucash/engine/test/test-qofid.cpp



More information about the gnucash-patches mailing list