You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesatee.apache.org by GitBox <gi...@apache.org> on 2019/11/21 08:02:01 UTC

[GitHub] [incubator-mesatee] m4sterchain commented on a change in pull request #69: Update mesapy to fix FNS/MesaPy FFI issues

m4sterchain commented on a change in pull request #69: Update mesapy to fix FNS/MesaPy FFI issues
URL: https://github.com/apache/incubator-mesatee/pull/69#discussion_r348938999
 
 

 ##########
 File path: mesatee_services/fns/sgx_trusted_lib/src/global.rs
 ##########
 @@ -132,10 +137,10 @@ extern "C" fn c_save_file_for_all_participants(
                 out_file_id[..file_id_len].copy_from_slice(file_id.as_bytes());
                 file_id_len as c_int
             } else {
-                out_file_id_buf_size as c_int - file_id_len as c_int
+                FFI_BUFFER_NOT_ENOUGH_ERROR
 
 Review comment:
   The current implementation of this branch implies that even if we successfully create and save the output file in the rust layer, the python script still gets  FFI_BUFFER_NOT_ENOUGH_ERROR, which will finally `raise mesatee_error(space, "Cannot save file")`.
   I suggest add the buffer_size check before calling `save_file_for_all_participants`.  
   
   Currently the type of a file_id is `String`, it might be a little weird to get the upper bound of its length to do the check. I think it's necessary to improve the internal data structure type definitions in the future.😄
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mesatee.apache.org
For additional commands, e-mail: dev-help@mesatee.apache.org