Skip to content

Commit

Permalink
Add comments to host env import code
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph M. Wintersteiger <[email protected]>
  • Loading branch information
wintersteiger committed Sep 15, 2020
1 parent 20cc35d commit 1e58739
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/enclave/enclave_oe.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ static void _copy_shared_memory(const sgxlkl_shared_memory_t* host)
"Could not allocate memory for host-imported environment "
"variables\n");

/* Import only those variable settings that are specified to be imported
* in cfg->host_import_env and ignore the others. */
size_t begin = 0;
sgxlkl_enclave_state.num_env_imported = 0;
for (size_t i = 0; i < henv_len; i++)
Expand All @@ -420,6 +422,7 @@ static void _copy_shared_memory(const sgxlkl_shared_memory_t* host)
const char* henv_i = henv + begin;
size_t henv_i_len = i - begin;

/* Find setting in cfg->host_import_env */
for (size_t j = 0; j < cfg->num_host_import_env; j++)
{
const char* name = cfg->host_import_env[j];
Expand Down

0 comments on commit 1e58739

Please sign in to comment.