1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #239 from AndrzejKurek/psa-its-file-fixes

Remove a potential call to fwrite with null buffer. Add UBsan testing
This commit is contained in:
Jaeden Amero
2019-09-05 16:40:08 +01:00
committed by GitHub
3 changed files with 10 additions and 7 deletions

View File

@ -214,9 +214,12 @@ psa_status_t psa_its_set( psa_storage_uid_t uid,
n = fwrite( &header, 1, sizeof( header ), stream );
if( n != sizeof( header ) )
goto exit;
n = fwrite( p_data, 1, data_length, stream );
if( n != data_length )
goto exit;
if( data_length != 0 )
{
n = fwrite( p_data, 1, data_length, stream );
if( n != data_length )
goto exit;
}
status = PSA_SUCCESS;
exit: