mirror of https://github.com/Gnucash/gnucash
Add NULL guards before dereferencing return values from GLib calls to prevent segmentation faults when GSettings schemas are missing (e.g., in library-only builds). The crash occurred when g_settings_schema_source_get_default() returned NULL and was passed directly to g_settings_schema_source_lookup(), causing a NULL pointer dereference. The existing G_IS_SETTINGS check came too late. Changes: - Add NULL check for schema_source before using it - Add NULL check for schema before calling g_settings_new_full() - Add NULL guard in gnc_settings_dump_schema_paths() for consistency - All callers already handle NULL returns via G_IS_SETTINGS checks Fixes: https://bugs.gnucash.org/show_bug.cgi?id=799740 https://claude.ai/code/session_01Cdnp3XkAQ29hG1eCxUSAUwpull/2179/head
parent
3cee6a3bbc
commit
606fc45582
Loading…
Reference in new issue