]> git.bitcoin.ninja Git - rust-lightning/commit
Handle feerates of `u32::MAX` without overflowing 2024-06-feerate-overflow
authorMatt Corallo <git@bluematt.me>
Wed, 26 Jun 2024 14:16:50 +0000 (14:16 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 26 Jun 2024 14:23:40 +0000 (14:23 +0000)
commite8bc0c92ad61cf607bd544124c69fd2b6a801776
tree30387a10e75a502f8580c2d638cea83d7569706d
parent88e1b56d66ff550b36a6d422f47c9b9729406f61
Handle feerates of `u32::MAX` without overflowing

Though we generally shouldn't be seeing these, and the
`get_dust_buffer_feerate` implementation will still return
`u32::MAX` in spite of the overflow, we should handle the overflow
to avoid panic when `debug_assertions` are enabled.

Found by the `full_stack_target` fuzzer
lightning/src/ln/channel.rs