Replaces the newly added assert for a devision by zero protection by a control structure. Floating point division by zero is defined by the floating point standard and results in +inf or -inf.
Fix crash via division by zero assertion #11508
pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2017/10/qt_cc_crash_zero changing 1 files +1 −2-
jonasschnelli commented at 5:46 AM on October 16, 2017: contributor
-
Fix crash via division by zero assertion 207408b088
- jonasschnelli added the label GUI on Oct 16, 2017
-
meshcollider commented at 5:49 AM on October 16, 2017: contributor
-
practicalswift commented at 10:05 AM on October 16, 2017: contributor
ACK 207408b0889caf3f5986bde4b122dbece1ed0dac :-)
-
in src/qt/coincontroldialog.cpp:585 in 207408b088
581 | @@ -582,8 +582,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) 582 | QString toolTipDust = tr("This label turns red if any recipient receives an amount smaller than the current dust threshold."); 583 | 584 | // how many satoshis the estimated fee can vary per byte we guess wrong 585 | - assert(nBytes != 0); 586 | - double dFeeVary = (double)nPayFee / nBytes; 587 | + double dFeeVary = (nBytes != 0) ? (double)nPayFee / nBytes : 0;
promag commented at 1:18 PM on October 17, 2017:Nit, like above in line 567:
double dFeeVary = nBytes > 0 ? (double)nPayFee / nBytes : 0;promag commented at 1:19 PM on October 17, 2017: memberutACK 207408b.
laanwj commented at 1:21 PM on October 18, 2017: memberutACK 207408b
Floating point division by zero is defined by the floating point standard and results in +inf or -inf.
Indeed, floating point division by zero is well-defined in IEEE 754 which all current platforms (certainly the ones bitcoind runs on) implement.
laanwj merged this on Oct 18, 2017laanwj closed this on Oct 18, 2017laanwj referenced this in commit ffa5159cef on Oct 18, 2017PastaPastaPasta referenced this in commit 37482b673c on Dec 22, 2019PastaPastaPasta referenced this in commit e6583f1493 on Jan 2, 2020PastaPastaPasta referenced this in commit 73dfcc1b8b on Jan 4, 2020PastaPastaPasta referenced this in commit 48674d576d on Jan 12, 2020PastaPastaPasta referenced this in commit d081812092 on Jan 12, 2020PastaPastaPasta referenced this in commit 04d29ce352 on Jan 12, 2020PastaPastaPasta referenced this in commit 16e8ca699a on Jan 12, 2020PastaPastaPasta referenced this in commit 078638d3a6 on Jan 12, 2020PastaPastaPasta referenced this in commit 1665e724e2 on Jan 12, 2020PastaPastaPasta referenced this in commit 467c52c75f on Jan 16, 2020ckti referenced this in commit 117b62c705 on Mar 28, 2021DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 18:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me