Merge remote-tracking branch 'upstream-public/pr/778' into mbedtls-2.7-proposed

This commit is contained in:
Gilles Peskine 2018-03-12 23:44:56 +01:00
commit c5671bdcf4
7 changed files with 65 additions and 15 deletions

View file

@ -1277,6 +1277,9 @@ int mbedtls_pk_parse_key( mbedtls_pk_context *pk,
{
unsigned char *key_copy;
if( keylen == 0 )
return( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT );
if( ( key_copy = mbedtls_calloc( 1, keylen ) ) == NULL )
return( MBEDTLS_ERR_PK_ALLOC_FAILED );