1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2026-01-06 11:41:12 +03:00

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: