commit | 58c17277754fc899a68f7ccd5c262c241b925a5c | [log] [tgz] |
---|---|---|
author | gabor-mezei-arm <gabor.mezei@arm.com> | Tue Jun 29 16:41:25 2021 +0200 |
committer | gabor-mezei-arm <gabor.mezei@arm.com> | Tue Jun 29 19:55:24 2021 +0200 |
tree | fc8192275d12db20b209ba7e758e318017f770bb | |
parent | 3f860e4c18a9f26509af6f3340e92bb668253f36 [diff] |
Add buffer overflow check Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
diff --git a/library/psa_crypto_cipher.c b/library/psa_crypto_cipher.c index 9bb21a0..3701f72 100644 --- a/library/psa_crypto_cipher.c +++ b/library/psa_crypto_cipher.c
@@ -390,6 +390,9 @@ status = mbedtls_to_psa_error( mbedtls_cipher_update( &operation->ctx.cipher, input, input_length, output, output_length ) ); + + if( *output_length > output_size ) + return PSA_ERROR_CORRUPTION_DETECTED; } return( status );