Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit 5f91bd2

Browse files
committed
fix(sgx): reference that is immediately dereferenced by the compiler
``` error: this expression borrows a reference (`&[u8]`) that is immediately dereferenced by the compiler Error: --> src/handler.rs:470:53 | 470 | let (c, shim_nonce_ptr) = c.copy_from_slice(&report_bytes).or(Err(libc::EMSGSIZE))?; | ^^^^^^^^^^^^^ help: change this to: `report_bytes` | ``` Signed-off-by: Harald Hoyer <harald@redhat.com>
1 parent 0f4d92d commit 5f91bd2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/shim-sgx/src/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ impl<'a> EnarxSyscallHandler for Handler<'a> {
467467
};
468468

469469
let c = self.new_cursor();
470-
let (c, shim_nonce_ptr) = c.copy_from_slice(&report_bytes).or(Err(libc::EMSGSIZE))?;
470+
let (c, shim_nonce_ptr) = c.copy_from_slice(report_bytes).or(Err(libc::EMSGSIZE))?;
471471
let (_, shim_buf_ptr) = c.alloc::<u8>(buf_len).or(Err(libc::EMSGSIZE))?;
472472
let req = request!(SYS_ENARX_GETATT => shim_nonce_ptr.as_ptr(), report_bytes.len(), shim_buf_ptr.as_ptr(), buf_len);
473473
let result = unsafe { self.proxy(req)? };

0 commit comments

Comments
 (0)