From fd236c6cc23876e7edfea6d590c59e413a9c4e55 Mon Sep 17 00:00:00 2001 From: Claudia Richoux Date: Thu, 2 Dec 2021 12:18:27 -0600 Subject: [PATCH] adding changes from fvm --- vm/actor/src/builtin/miner/state.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vm/actor/src/builtin/miner/state.rs b/vm/actor/src/builtin/miner/state.rs index d32f48b78665..feca40ee18ed 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))?