1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Check invalid nc_off

Uninitialized nc_off value >0xf passed by the caller can cause array out-of-bound.
This commit is contained in:
Mohammad Azim Khan
2017-11-23 17:49:05 +00:00
committed by Azim Khan
parent 4ca9a45756
commit 3f7f8170d6
2 changed files with 4 additions and 0 deletions

View File

@ -1082,6 +1082,9 @@ int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
int c, i;
size_t n = *nc_off;
if ( n > 0x0F )
return( MBEDTLS_ERR_AES_BAD_INPUT_DATA );
while( length-- )
{
if( n == 0 ) {