Skip to content

Commit

Permalink
Fix buffer check error of p_additional_MACtext_length
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Ding <dingelish@gmail.com>
  • Loading branch information
dingelish committed Sep 14, 2018
1 parent 18d0f68 commit 371d48e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdk/tseal/tSeal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ extern "C" sgx_status_t sgx_unseal_data(const sgx_sealed_data_t *p_sealed_data,
}

if((p_additional_MACtext_length != NULL) &&
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)))))
(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)))))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/tseal/tSeal_aad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ extern "C" sgx_status_t sgx_unmac_aadata(const sgx_sealed_data_t *p_sealed_data,
{
return SGX_ERROR_INVALID_PARAMETER;
}
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(p_additional_MACtext_length))))
if(!(sgx_is_within_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length)) ||
sgx_is_outside_enclave(p_additional_MACtext_length, sizeof(*p_additional_MACtext_length))))
{
return SGX_ERROR_INVALID_PARAMETER;
}
Expand Down

0 comments on commit 371d48e

Please sign in to comment.