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

This commit is contained in:
Gilles Peskine 2018-03-12 23:45:08 +01:00
commit a31d8206b1
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 );