Add buffer overflow check

Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
gabor-mezei-arm 2021-06-29 16:41:25 +02:00
parent 6f8d43df20
commit 42373bdde7
No known key found for this signature in database
GPG key ID: 106F5A41ECC305BD

View file

@ -393,6 +393,9 @@ static psa_status_t cipher_update( mbedtls_psa_cipher_operation_t *operation,
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 );