gnucash unstable: Fix null pointer dereference segfault.

John Ralls jralls at code.gnucash.org
Tue Nov 28 18:41:37 EST 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/5aa048e0 (commit)
	from  https://github.com/Gnucash/gnucash/commit/a5bf4e00 (commit)



commit 5aa048e01d4ae949505a5ccd5ad15c13bf1edc44
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Nov 28 15:39:41 2017 -0800

    Fix null pointer dereference segfault.
    
    Reported via PR 21y by github user ethaden.
    This is a simpler fix than the one in the PR.

diff --git a/gnucash/import-export/aqb/gnc-ab-kvp.c b/gnucash/import-export/aqb/gnc-ab-kvp.c
index 764afa3..80be042 100644
--- a/gnucash/import-export/aqb/gnc-ab-kvp.c
+++ b/gnucash/import-export/aqb/gnc-ab-kvp.c
@@ -102,7 +102,7 @@ gnc_ab_get_account_trans_retrieval(const Account *a)
     qof_instance_get (QOF_INSTANCE (a),
 		      "ab-trans-retrieval", &t,
 		      NULL);
-    return *t;
+    return t ? *t : (Timespec){0, 0};
 }
 
 void



Summary of changes:
 gnucash/import-export/aqb/gnc-ab-kvp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list