informalsystems / tendermint-rs

Client libraries for Tendermint/CometBFT in Rust!
Apache License 2.0
587 stars 213 forks source link

tendermint: ensure ValidatorIndex is ≤ i32::MAX #1411

Closed mina86 closed 2 months ago

mina86 commented 2 months ago

During conversion from usize to ValidatorIndex first convert the value to i32 to make sure that the value is ≤ i32::MAX. Without that intermediate conversion, u32::MAX as usize is successfully converted into the index.