Avoid overflow in addition when checking counterparty feerates 2022-01-fuzz-overflow
authorMatt Corallo <git@bluematt.me>
Wed, 26 Jan 2022 00:10:19 +0000 (00:10 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 26 Jan 2022 00:10:19 +0000 (00:10 +0000)
commitb54fe5fcc761e7d50c4388d605f1fcbde5aec41a
treef6fc158dae732afed7fd83e88b7238bc84c98967
parent35d4ebb208255724804187e3f10553c9383c9522
Avoid overflow in addition when checking counterparty feerates

This is harmless outside of debug builds - the feerate will
overflow causing it to either spuriously fail the first check, or
correctly pass it and fail the second check. In debug builds,
however, it panics due to integer overflow.

Found by the `full_stack_target` fuzz test in the
Chaincode-provided continuous fuzzing. Thanks Chaincode!
lightning/src/ln/channel.rs