mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Avoid SIGFPE due to modulo-by-zero is the requested number of significant
figures is greater than log10(2^63). BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14512 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e3f064f002
commit
f0d64c1185
@ -785,6 +785,9 @@ gnc_numeric_convert(gnc_numeric in, gint64 denom, gint how)
|
||||
}
|
||||
sigfigs = GNC_HOW_GET_SIGFIGS(how);
|
||||
|
||||
if (fabs(sigfigs - logratio) > 18)
|
||||
return gnc_numeric_error(GNC_ERROR_OVERFLOW);
|
||||
|
||||
if(sigfigs-logratio >= 0) {
|
||||
denom = (gint64)(pow(10, sigfigs-logratio));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user