r14559 - gnucash/branches/2.0 - Avoid SIGFPE due to modulo-by-zero is the requested number of significant
Derek Atkins
warlord at cvs.gnucash.org
Tue Jul 25 18:22:56 EDT 2006
Author: warlord
Date: 2006-07-25 18:22:55 -0400 (Tue, 25 Jul 2006)
New Revision: 14559
Trac: http://svn.gnucash.org/trac/changeset/14559
Modified:
gnucash/branches/2.0/
gnucash/branches/2.0/ChangeLog
gnucash/branches/2.0/lib/libqof/qof/gnc-numeric.c
Log:
Avoid SIGFPE due to modulo-by-zero is the requested number of significant
figures is greater than log10(2^63).
Merge from r14512
Property changes on: gnucash/branches/2.0
___________________________________________________________________
Name: svk:merge
- d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:12927
+ d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/2.0:12928
Modified: gnucash/branches/2.0/ChangeLog
===================================================================
--- gnucash/branches/2.0/ChangeLog 2006-07-25 22:22:46 UTC (rev 14558)
+++ gnucash/branches/2.0/ChangeLog 2006-07-25 22:22:55 UTC (rev 14559)
@@ -33,6 +33,12 @@
* src/business/business-gnome/dialog-invoice.c:
Set the summary bar values when the window is first opened (#345978).
+2006-07-15 Chris Shoemaker <chris.shoemaker at cox.net>
+
+ * lib/libqof/qof/gnc-numeric.c:
+ Avoid SIGFPE due to modulo-by-zero is the requested number of
+ significant figures is greater than log10(2^63).
+
2006-07-15 Christian Stimming <stimming at tuhh.de>
* src/import-export/hbci/druid-hbci-initial.c: Remove obsolete
Modified: gnucash/branches/2.0/lib/libqof/qof/gnc-numeric.c
===================================================================
--- gnucash/branches/2.0/lib/libqof/qof/gnc-numeric.c 2006-07-25 22:22:46 UTC (rev 14558)
+++ gnucash/branches/2.0/lib/libqof/qof/gnc-numeric.c 2006-07-25 22:22:55 UTC (rev 14559)
@@ -785,6 +785,9 @@
}
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));
}
More information about the gnucash-changes
mailing list