The "placeholder" variable in dialog-account-picker.c:dialog_response_cb() may
be uninitialised before use if gtk_tree_selection_get_selected() returns
false.
Initialise it to true:
"jralls: The signal is blocked if the account is a placeholder, meaning
that one can't post splits to it. One also can't post splits to no account,
so the signal should be blocked in that case too."
It shouldn't be possible for the number of columns to be different between
the header cursor and the other cursors but the return value from
g_table_index() is checked just in case this happens.
If this did happen, the width would be set using an uninitialised value
so initialise them all to 0.
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 cb273b13a1 when the number of splits
would have been determined to be 0 for the SCM_UNDEFINED value of
"trans_scm".
The column value appears to be unused by gnc_split_register_show_trans()
but vc_loc.virt_col is an int so its value will not have been default
initialised. Set it to 0 to be consistent with other callers.
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.
If "test for valid value" is false, errmsg is set which means there is then
a read of "toclear_value" which has not been initialised.
Initialise it to indicate an error with the value.
ACCT_TYPE_NONE is -1 but it should always be masked out by compat;
explicitly check for this instead of relying on that.
Add parenthesis to be clear that the default precedence is what's intended.
Return a gnc_numeric instead of allocations that every caller has to free.
This makes it easier to fix the use after free in the unit test function
equals_node_val_vs_split_internal() where the expression in the return
statement wants to use the allocated gnc_numeric.
The "source" parameter is checked once at the start before using strcmp()
but is then used later on in GncQuotesImpl::query_fq() with function calls
that can't handle null values.
81b9a02235 changed the behaviour of the
"success" variable that's used for the return value, so now the value is
being repeatedly overwritten instead of being combined with the result of
the next call.
Restore the original behaviour of setting success to false on failure.
When the page already exists in a window then we can't be restoring pages
so stop checking. The "window" variable will be nullptr if we're trying to
open the page "in any window".
This bug was introduced in the changes for bug 798564.
- Don't save the address of a stack variable
==105765== Conditional jump or move depends on uninitialised value(s)
==105765== at 0x10E763: test_gnc_float_txn_to_txn_swap_accounts (utest-split-register-copy-ops.c:540)
==105765== by 0x5109675: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x5109BC9: g_test_run_suite (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x5103FFC: g_test_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x10BC6F: main (test-split-register.c:45)
==105765==
==105765== Conditional jump or move depends on uninitialised value(s)
==105765== at 0x4877C57: gnc_float_txn_to_txn_swap_accounts (split-register-copy-ops.c:433)
==105765== by 0x10E7E1: test_gnc_float_txn_to_txn_swap_accounts (utest-split-register-copy-ops.c:548)
==105765== by 0x5109675: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x5109BC9: g_test_run_suite (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x5103FFC: g_test_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x10BC6F: main (test-split-register.c:45)
==105765==
==105765== Conditional jump or move depends on uninitialised value(s)
==105765== at 0x10EFC1: test_gnc_float_txn_to_txn_swap_accounts (utest-split-register-copy-ops.c:589)
==105765== by 0x5109675: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x510938A: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x5109BC9: g_test_run_suite (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x5103FFC: g_test_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==105765== by 0x10BC6F: main (test-split-register.c:45)
==4031== Invalid read of size 8
==4031== at 0x4E58C09: gncVendorGetAddr (gncVendor.c:677)
==4031== by 0x10A7E3: test_vendor (test-vendor.c:97)
...
==4031== Address 0x7e0c4e8 is 168 bytes inside a block of size 232 free'd
==4031== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4031== by 0x51526C3: g_type_free_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4031== by 0x4E58616: gncVendorFree (gncVendor.c:511)
==4031== by 0x4E58EFF: vendor_free (gncVendor.c:782)
==4031== by 0x4E8611E: qof_commit_edit_part2 (qofinstance.cpp:1034)
==4031== by 0x4E58F59: gncVendorCommitEdit (gncVendor.c:788)
==4031== by 0x4E584EF: gncVendorDestroy (gncVendor.c:483)
==4031== by 0x10A729: test_vendor (test-vendor.c:80)
...
==4031== Block was alloc'd at
==4031== at 0x4848A13: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4031== by 0x5033550: g_malloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==4031== by 0x5157CBC: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4031== by 0x513F20F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4031== by 0x51407B7: g_object_new_with_properties (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4031== by 0x5141560: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4031== by 0x4E583CF: gncVendorCreate (gncVendor.c:459)
==4031== by 0x10A6A5: test_vendor (test-vendor.c:74)
...
==4029== Invalid read of size 8
==4029== at 0x4E41F15: gncEmployeeGetAddr (gncEmployee.c:642)
==4029== by 0x10A8A5: test_employee (test-employee.c:97)
...
==4029== Address 0x7e0c208 is 152 bytes inside a block of size 248 free'd
==4029== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4029== by 0x51526C3: g_type_free_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4029== by 0x4E418D5: gncEmployeeFree (gncEmployee.c:477)
==4029== by 0x4E42144: emp_free (gncEmployee.c:714)
==4029== by 0x4E8611E: qof_commit_edit_part2 (qofinstance.cpp:1034)
==4029== by 0x4E4219E: gncEmployeeCommitEdit (gncEmployee.c:721)
==4029== by 0x4E41823: gncEmployeeDestroy (gncEmployee.c:459)
==4029== by 0x10A77F: test_employee (test-employee.c:79)
...
==4029== Block was alloc'd at
==4029== at 0x4848A13: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4029== by 0x5033550: g_malloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==4029== by 0x5157CBC: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4029== by 0x513F20F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4029== by 0x51407B7: g_object_new_with_properties (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4029== by 0x5141560: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4029== by 0x4E416DA: gncEmployeeCreate (gncEmployee.c:434)
==4029== by 0x10A6FB: test_employee (test-employee.c:73)
...
==4028== Invalid read of size 8
==4028== at 0x4E3F641: gncCustomerGetAddr (gncCustomer.c:579)
==4028== by 0x10A8EE: test_customer (test-customer.c:90)
...
==4028== Address 0x7e861b8 is 168 bytes inside a block of size 272 free'd
==4028== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4028== by 0x51526C3: g_type_free_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x4E3EDD6: gncCustomerFree (gncCustomer.c:368)
==4028== by 0x4E3F57B: cust_free (gncCustomer.c:551)
==4028== by 0x4E8611E: qof_commit_edit_part2 (qofinstance.cpp:1034)
==4028== by 0x4E3F5D5: gncCustomerCommitEdit (gncCustomer.c:557)
==4028== by 0x4E3EC89: gncCustomerDestroy (gncCustomer.c:338)
==4028== by 0x10A7EC: test_customer (test-customer.c:71)
...
==4028== Block was alloc'd at
==4028== at 0x4848A13: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4028== by 0x5033550: g_malloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==4028== by 0x5157CBC: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x513F20F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x51407B7: g_object_new_with_properties (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x5141560: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x4E3EB0D: gncCustomerCreate (gncCustomer.c:309)
==4028== by 0x10A768: test_customer (test-customer.c:66)
...
==4028== Invalid read of size 8
==4028== at 0x4E3F796: gncCustomerGetShipAddr (gncCustomer.c:633)
==4028== by 0x10A91D: test_customer (test-customer.c:91)
...
==4028== Address 0x7e86210 is 256 bytes inside a block of size 272 free'd
==4028== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4028== by 0x51526C3: g_type_free_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x4E3EDD6: gncCustomerFree (gncCustomer.c:368)
==4028== by 0x4E3F57B: cust_free (gncCustomer.c:551)
==4028== by 0x4E8611E: qof_commit_edit_part2 (qofinstance.cpp:1034)
==4028== by 0x4E3F5D5: gncCustomerCommitEdit (gncCustomer.c:557)
==4028== by 0x4E3EC89: gncCustomerDestroy (gncCustomer.c:338)
==4028== by 0x10A7EC: test_customer (test-customer.c:71)
...
==4028== Block was alloc'd at
==4028== at 0x4848A13: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==4028== by 0x5033550: g_malloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==4028== by 0x5157CBC: g_type_create_instance (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x513F20F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x51407B7: g_object_new_with_properties (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x5141560: g_object_new (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7600.1)
==4028== by 0x4E3EB0D: gncCustomerCreate (gncCustomer.c:309)
==4028== by 0x10A768: test_customer (test-customer.c:66)
...
==7520== Invalid read of size 8
==7520== at 0x4E36DCC: guid_copy (guid.cpp:123)
==7520== by 0x1E3E62: KvpValueImpl::duplicate(KvpValueImpl const&) (kvp-value.cpp:378)
==7520== by 0x1E31CC: KvpValueImpl::KvpValueImpl(KvpValueImpl const&) (kvp-value.cpp:36)
==7520== by 0x1FF6C3: KvpValueTest_Copy_Test::TestBody() (test-kvp-value.cpp:74)
...
==7520== Address 0x7e10f48 is 8 bytes inside a block of size 16 free'd
==7520== at 0x4846AFF: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==7520== by 0x4E36D98: guid_free (guid.cpp:115)
==7520== by 0x1E3D04: void delete_visitor::operator()<_gncGuid*>(_gncGuid*&) (kvp-value.cpp:358)
...
==7520== Block was alloc'd at
==7520== at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==7520== by 0x4E36D5C: guid_malloc (guid.cpp:105)
==7520== by 0x4E36DC3: guid_copy (guid.cpp:122)
==7520== by 0x4E36EB0: guid_new (guid.cpp:153)
==7520== by 0x1FF4DB: KvpValueTest_Copy_Test::TestBody() (test-kvp-value.cpp:68)
Report options need to be saved when they're different from the
defaults, book options need to be saved when their value changes
regardless of whether it's the default value. That's dirty. Implement
it.
When a description popup has long text a horizontal scroll bar will be
used. If a subsequent popup has short text which does not need a scroll
bar, the previous one is still visible so queue a tree view column
resize to reevaluate the need for a scroll bar.
When editing an existing entry, similar descriptions would not show so
instead of using the whole of the description text to search on just
use the portion up to the cursor.