diff --git a/vm/actor/src/builtin/miner/state.rs b/vm/actor/src/builtin/miner/state.rs index 2b4989713e7a..7ad119c98881 100644 --- a/vm/actor/src/builtin/miner/state.rs +++ b/vm/actor/src/builtin/miner/state.rs @@ -1153,6 +1153,11 @@ impl State { let precommitted = make_map_with_root_and_bitwidth(&self.pre_committed_sectors, store, HAMT_BIT_WIDTH)?; for sector_no in sector_nos.iter() { + if sector_no > fil_types::MAX_SECTOR_NUMBER as usize { + return Err( + actor_error!(ErrIllegalArgument, "sector number greater than maximum").into(), + ); + } let info: &SectorPreCommitOnChainInfo = precommitted .get(&u64_key(sector_no as u64))?