From 010fbf9dccd423069cca7bbb1282e9dfaa7330a4 Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Tue, 19 Nov 2024 18:26:31 +0900 Subject: [PATCH] fix to remove unnecessary slicing Signed-off-by: Jun Kimura --- modules/remote-attestation/src/ias_utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/remote-attestation/src/ias_utils.rs b/modules/remote-attestation/src/ias_utils.rs index bd3346e2..23bec347 100644 --- a/modules/remote-attestation/src/ias_utils.rs +++ b/modules/remote-attestation/src/ias_utils.rs @@ -415,6 +415,7 @@ pub(crate) fn decode_spid(spid_str: &str) -> Result { } }; 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) }