mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-05 06:26:52 +00:00
Check for buffer overflow in test function
This commit is contained in:
parent
08f06eb049
commit
9c16ede466
1 changed files with 1 additions and 0 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue