DimanNe opened a new issue, #288:
URL: https://github.com/apache/teaclave-trustzone-sdk/issues/288

   If yes, I do not understand why.
   
   Here is its code:
   
   ```rust
       pub fn create(
           storage_id: ObjectStorageConstants,
           object_id: &[u8],
           flags: DataFlag,
           attributes: Option<ObjectHandle>,
           initial_data: &[u8],
       ) -> Result<Self> {
           let mut handle: raw::TEE_ObjectHandle = core::ptr::null_mut();
           // Move as much code as possible out of unsafe blocks to maximize 
Rust’s
           // safety checks.
           let handle_mut = &mut handle;
           let attributes = match attributes {
               Some(a) => a.handle(), <------ HERE
               None => core::ptr::null_mut(),
           };
   ```
   
   It takes ObjectHandle by value.
   This means that a here is value:
   `Some(a) => a.handle(),`
   which means it gets **dropped** right after match.
   
   And then you are using raw pointer obtained from it?..
   
   What is going on here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to