mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-03-26 06:01:09 +01:00
Check for buffer overflow in test function
This commit is contained in:
@@ -123,6 +123,7 @@ void pk_parse_key( char *key_data, int result )
|
||||
mbedtls_pk_init( &pk );
|
||||
|
||||
memset( buf, 0, sizeof( buf ) );
|
||||
TEST_ASSERT( strlen( key_data ) / 2 <= sizeof( buf ) );
|
||||
data_len = unhexify( buf, key_data );
|
||||
|
||||
TEST_ASSERT( mbedtls_pk_parse_key( &pk, buf, data_len, NULL, 0 ) == result );
|
||||
|
||||
Reference in New Issue
Block a user