mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[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
This commit is contained in:
parent
8f68d54292
commit
6de712b501
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user