Skip to content

Commit

Permalink
fix: audit issue F2 (#1289)
Browse files Browse the repository at this point in the history
* Fix error message to be the same as in the specification

* Fix incorrect reads order

Co-authored-by: noot <elizabethjbinks@gmail.com>
  • Loading branch information
elmattic and noot authored Nov 30, 2021
1 parent cddd5f9 commit c7657b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions vm/actor/src/builtin/verifreg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,19 +453,19 @@ impl Actor {
}

rt.transaction(|st: &mut State, rt| {
let mut verified_clients =
make_map_with_root_and_bitwidth(&st.verified_clients, rt.store(), HAMT_BIT_WIDTH)
.map_err(|e| {
e.downcast_default(ExitCode::ErrIllegalState, "failed to load verified clients")
})?;
let verifiers = make_map_with_root_and_bitwidth::<_, BigIntDe>(
&st.verifiers,
rt.store(),
HAMT_BIT_WIDTH,
)
.map_err(|e| {
e.downcast_default(ExitCode::ErrIllegalState, "failed to load verified clients")
e.downcast_default(ExitCode::ErrIllegalState, "failed to load verifiers")
})?;
let mut verified_clients =
make_map_with_root_and_bitwidth(&st.verified_clients, rt.store(), HAMT_BIT_WIDTH)
.map_err(|e| {
e.downcast_default(ExitCode::ErrIllegalState, "failed to load verified clients")
})?;

// validate we are NOT attempting to do this for a verifier
let found = verifiers.contains_key(&client.to_bytes()).map_err(|e| {
Expand Down

0 comments on commit c7657b8

Please sign in to comment.