Skip to content

Commit

Permalink
fix to remove unnecessary slicing
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
  • Loading branch information
bluele committed Nov 19, 2024
1 parent c195872 commit 010fbf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/remote-attestation/src/ias_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ pub(crate) fn decode_spid(spid_str: &str) -> Result<sgx_spid_t, Error> {
}
};
let mut spid = sgx_spid_t::default();
spid.id.copy_from_slice(&decoded_vec[..16]);
// the length of `decoded_vec` is 16 because each byte is represented by 2 characters
spid.id.copy_from_slice(&decoded_vec);
Ok(spid)
}

0 comments on commit 010fbf9

Please sign in to comment.