[GNC-dev] gnucash maint: Multiple changes pushed
John Ralls
jralls at ceridwen.fremont.ca.us
Fri Nov 30 02:42:52 EST 2018
> On Nov 30, 2018, at 4:27 PM, Geert Janssens <geert.gnucash at kobaltwit.be> wrote:
>
> Op vrijdag 30 november 2018 08:12:02 CET schreef John Ralls:
>> Updated via https://github.com/Gnucash/gnucash/commit/3f09e5c6 (commit)
>> via https://github.com/Gnucash/gnucash/commit/e81bcf6e (commit)
>> via https://github.com/Gnucash/gnucash/commit/bf55c30a (commit)
>> via https://github.com/Gnucash/gnucash/commit/a9344841 (commit)
>> via https://github.com/Gnucash/gnucash/commit/f5260996 (commit)
>> via https://github.com/Gnucash/gnucash/commit/185787d7 (commit)
>> via https://github.com/Gnucash/gnucash/commit/8ed9a9c4 (commit)
>> via https://github.com/Gnucash/gnucash/commit/7e10b05c (commit)
>> via https://github.com/Gnucash/gnucash/commit/7283c86f (commit)
>> via https://github.com/Gnucash/gnucash/commit/876bfd19 (commit)
>> via https://github.com/Gnucash/gnucash/commit/24ce9205 (commit)
>> via https://github.com/Gnucash/gnucash/commit/8f22c4be (commit)
>> via https://github.com/Gnucash/gnucash/commit/4ffeb3ef (commit)
>> via https://github.com/Gnucash/gnucash/commit/43a30e1c (commit)
>> via https://github.com/Gnucash/gnucash/commit/3d136275 (commit)
>> via https://github.com/Gnucash/gnucash/commit/606d9cfe (commit)
>> via https://github.com/Gnucash/gnucash/commit/faba7975 (commit)
>> from https://github.com/Gnucash/gnucash/commit/de6c173e (commit)
>>
>>
>>
>> commit 3f09e5c6f1af66223503eca9adee84e9a346e42a
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Fri Nov 30 16:11:42 2018 +0900
>>
>> Only disable register warnings for SWIG 2.
>>
>> SWIG 3 has removed the register storage class markers.
>>
>> commit e81bcf6e33bc5bcf2af8aca6931e537889e1a17a
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Fri Nov 30 14:44:49 2018 +0900
>>
>> Fix the remaining static analysis warnings.
>>
>> Except two incorrect leak warnings and one about mktemp
>> being insecure in the XML backend. See the respective
>> comments about those.
>>
>> commit bf55c30aeb2a94a6bd29015278d8aa84e498011e
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Fri Nov 30 13:56:08 2018 +0900
>>
>> Fix most of the unused assignment errors from static analysis.
>>
>> There are a very few left that need deeper study, but this gets
>> rid of most of the noise. For the most part it's just getting rid of
>> extra variables or removing an assignment that is always
>> replaced later but before any reads of the variable. A few are
>> discarded result variables.
>>
>> commit a93448414f3e790e52a3f627f7f4b6c5df463a98
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Fri Nov 30 13:52:21 2018 +0900
>>
>> Fix another uninitialized variable in register.
>>
>> Found by clang static analyzer.
>>
>> commit f52609961e43b165f532ebe2d234626ceaa4372f
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Thu Nov 29 21:49:54 2018 +0900
>>
>> Fix uninitialized variables (and one leak) in gnome.
>>
>> Found by clang static analyzer.
>>
>> commit 185787d7be17b4927b4b0396f317ff2cc20e5eea
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 22:24:41 2018 +0900
>>
>> Initialize some gnc_numerics that could be returned uninitialized.
>>
>> Found by clang static analyzer.
>>
>> commit 8ed9a9c43af638276343dd886daea958079ef768
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 22:22:28 2018 +0900
>>
>> Initialize some variables that could be otherwise used uninitialized.
>>
>> Found by clang static analyzer.
>>
>> commit 7e10b05c494f262ca7c31fd8c8bc54d61a8fed98
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 22:07:01 2018 +0900
>>
>> Avoid over-ranging string storage.
>>
>> Found by clang static analyzer.
>>
>> commit 7283c86f6f0a20cd9bdbe7587273c2b625026cce
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 21:58:05 2018 +0900
>>
>> Fix various static analysis logic errors in gnome-utils.
>>
>> commit 876bfd19ad2c7d80d8dae008241c9ef67f1655a2
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 16:18:34 2018 +0900
>>
>> Protect against nullptr dereference, remove unused GError.
>>
>> Found by clang static analyzer.
>>
>> commit 24ce92056ddf5f6137827467634ddb1ef7e2bc75
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 16:11:32 2018 +0900
>>
>> Protect from potential nullptr dereferences.
>>
>> pmtsched is created in only one banch of the opening switch.
>> Found by clang static analyzer.
>>
>> commit 8f22c4bed4a3da692cbfb042d5b671cd80fb00ec
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 15:41:45 2018 +0900
>>
>> Localize variables, ensure that val_imbalance is set, test txn_curr !=
>> commodity once.
>>
>> Found by clang static analyzer.
>>
>> commit 4ffeb3efac85cd1650f33fb4acd0665936307213
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 15:40:21 2018 +0900
>>
>> Ensure that a dereferenced variable isn't NULL.
>>
>> Found by clang static analyzer.
>>
>> commit 43a30e1c9799fba2c926f59d488fdfbcd9f6ff54
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 15:39:07 2018 +0900
>>
>> Silence clang static analyzer complaint about potential div by 0.
>>
>> It can't, because if b is 0 the function would have
>> returned already; since b.m_hi is 0 b.m_lo can't be. The assert
>> reassures clang that this is the case.
>>
>> commit 3d1362757be1c8ac73f2f7937ac0dcd696ca6f46
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 15:37:25 2018 +0900
>>
>> Prevent potential undefined behavior by shifting by a wrapped uint.
>>
>> Found by clang static analyzer.
>>
>> commit 606d9cfee6d64c3ae9ee3d9bed6532e98b4b1a37
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 15:36:06 2018 +0900
>>
>> Prevent potential nullptr dereference.
>>
>> Found by clang static analyzer.
>>
>> commit faba7975aca2647792139ed61ca2aabfc1b707a6
>> Author: John Ralls <jralls at ceridwen.us>
>> Date: Wed Nov 28 14:48:42 2018 +0900
>>
>> Fix a bunch of memory allocation errors found by clang static analysis.
>>
>>
>>
>> Summary of changes:
>> CMakeLists.txt | 4 ++
>> borrowed/gwengui-gtk3/gtk3_gui_dialog.c | 2 -
>> borrowed/gwengui-gtk3/w_checkbox.c | 11 ++--
>> borrowed/gwengui-gtk3/w_combobox.c | 9 ++--
>> borrowed/gwengui-gtk3/w_dialog.c | 2 -
>> borrowed/gwengui-gtk3/w_gridlayout.c | 4 --
>> borrowed/gwengui-gtk3/w_groupbox.c | 2 -
>> borrowed/gwengui-gtk3/w_hlayout.c | 2 -
>> borrowed/gwengui-gtk3/w_hline.c | 2 -
>> borrowed/gwengui-gtk3/w_hspacer.c | 2 -
>> borrowed/gwengui-gtk3/w_label.c | 2 -
>> borrowed/gwengui-gtk3/w_lineedit.c | 18 +++----
>> borrowed/gwengui-gtk3/w_listbox.c | 13 ++---
>> borrowed/gwengui-gtk3/w_progressbar.c | 4 --
>> borrowed/gwengui-gtk3/w_pushbutton.c | 11 ++--
>> borrowed/gwengui-gtk3/w_radiobutton.c | 10 ++--
>> borrowed/gwengui-gtk3/w_scrollarea.c | 2 -
>> borrowed/gwengui-gtk3/w_spinbox.c | 13 ++---
>> borrowed/gwengui-gtk3/w_stack.c | 2 -
>> borrowed/gwengui-gtk3/w_tabbook.c | 2 -
>> borrowed/gwengui-gtk3/w_textbrowser.c | 2 -
>> borrowed/gwengui-gtk3/w_textedit.c | 5 +-
>> borrowed/gwengui-gtk3/w_vlayout.c | 2 -
>> borrowed/gwengui-gtk3/w_vline.c | 2 -
>> borrowed/gwengui-gtk3/w_vspacer.c | 2 -
>> borrowed/jenny/jenny.c | 9 +---
>
> Impressive work.
>
> Will you send these patches to the respective upstream projects as well ?
Nowhere near as impressive as it looks. ;-) Clang’s static analyzer did most of the real work. Nearly all of the fixes were pretty obvious once they were pointed out.
I don’t think that jenny is maintained. I’ll do a PR for Gwen, though I’m not sure that cleanup is something Martin is interested in.
Regards,
John Ralls
More information about the gnucash-devel
mailing list