This fixes the crash described in #824 (and two more potential crashes). You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/827
-- Commit Summary --
* scope: moved some initializations behind parameter checks in 'scptreestore.c'
-- File Changes --
M scope/src/store/scptreestore.c (15)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/827.patch https://github.com/geany/geany-plugins/pull/827.diff
This is not really the right fix, `g_return_*if_fail()` is supposed to catch programming error, to check the contract between the caller and the callee. Admittedly here the values are accessed before the contract is checked, which is probably worth fixing, but the bug itself is that these functions get called with values they are not supposed to.
I will try to find the trouble source. Anyway I would like to keep the existing changes for better stability in case of an error.
Done. The wrong call came from ```stack_entry()``` because of not checking the result of ```gtk_tree_selection_get_selected()```.
@b4n: do you request more changes? I would like to merge this soon.
Merged #827 into master.
github-comments@lists.geany.org