diff options
-rw-r--r-- | core/lib/libtomcrypt/sm2-pke.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/lib/libtomcrypt/sm2-pke.c b/core/lib/libtomcrypt/sm2-pke.c index 9d1d8958..ae189cc4 100644 --- a/core/lib/libtomcrypt/sm2-pke.c +++ b/core/lib/libtomcrypt/sm2-pke.c @@ -246,8 +246,10 @@ TEE_Result sm2_ltc_pke_decrypt(struct ecc_keypair *key, const uint8_t *src, *dst_len = out_len; if (out_len < C2_len) { eom = calloc(1, C2_len - out_len); - if (!eom) + if (!eom) { + res = TEE_ERROR_OUT_OF_MEMORY; goto out; + } for (i = out_len; i < C2_len; i++) eom[i - out_len] = src[C1_len + i] ^ t[i]; } |