Add null check for pms allocation

Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
Przemek Stekiel 2022-04-20 08:33:13 +02:00
parent 7f1c89d1d4
commit 937b90febf

View file

@ -5284,6 +5284,8 @@ static psa_status_t psa_tls12_prf_psk_to_ms_set_key(
return( PSA_ERROR_INVALID_ARGUMENT );
uint8_t *pms = mbedtls_calloc( 1, pms_len );
if( pms == NULL )
return( PSA_ERROR_INSUFFICIENT_MEMORY );
uint8_t *cur = pms;
/* pure-PSK: