gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Tue Apr 14 20:13:19 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/4cb2e4d1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6de712b5 (commit)
	from  https://github.com/Gnucash/gnucash/commit/218e18a4 (commit)



commit 4cb2e4d144ab19a93d18ad8688f143c504878b9d
Merge: 218e18a43 6de712b50
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Wed Apr 15 08:12:54 2020 +0800

    Merge branch 'maint-strengthen-exp-parser' into maint


commit 6de712b501c8c89ddae7b605381c882929bd6695
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Tue Apr 14 23:40:37 2020 +0800

    [gnc-exp-parser] don't crash when gnc:fn returns non-number
    
    if gnc:fn returns anything other than a number, abort rather than
    crash

diff --git a/libgnucash/app-utils/gnc-exp-parser.c b/libgnucash/app-utils/gnc-exp-parser.c
index 38c011980..60dc88d6d 100644
--- a/libgnucash/app-utils/gnc-exp-parser.c
+++ b/libgnucash/app-utils/gnc-exp-parser.c
@@ -339,6 +339,12 @@ func_op(const char *fname, int argc, void **argv)
         return NULL;
     }
 
+    if (!scm_is_number (scmTmp))
+    {
+        PERR("function gnc:%s does not return a number", fname);
+        return NULL;
+    }
+
     result = g_new0( gnc_numeric, 1 );
     *result = double_to_gnc_numeric( scm_to_double(scmTmp),
                                      GNC_DENOM_AUTO,



Summary of changes:
 libgnucash/app-utils/gnc-exp-parser.c | 6 ++++++
 1 file changed, 6 insertions(+)



More information about the gnucash-changes mailing list