Skip to content

Commit

Permalink
Fix the invalid free in xtest 9089
Browse files Browse the repository at this point in the history
when the ALLOCATE_SHARED_MEMORY get failed, it will directly go to the
exit, and do an invalid free in CRYPTO_FREE(mac)

Reviewed-by: Jerome Forissier <[email protected]>
Reviewed-by: David Brown <[email protected]>
Signed-off-by: Zeng Tao <[email protected]>
  • Loading branch information
prime-zeng authored and jforissier committed Aug 19, 2016
1 parent e385416 commit e8974c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion host/xtest/xml/include/xml_crypto_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,8 @@ static TEEC_Result Invoke_Crypto_MACCompareFinal(

res = TEEC_InvokeCommand(s, cmd_id, &op, &ret_orig);

exit:
CRYPTO_FREE(mac);
exit:
TEEC_ReleaseSharedMemory(SHARE_MEM01);
TEEC_ReleaseSharedMemory(SHARE_MEM02);
return res;
Expand Down

0 comments on commit e8974c6

Please sign in to comment.