mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 14:05:32 +00:00
Only zeroize buffer if the buffer length is non-zero
This commit is contained in:
parent
8593bca7f8
commit
8096cafa94
|
@ -1235,7 +1235,8 @@ static psa_status_t psa_copy_key_material( const psa_key_slot_t *source,
|
|||
status = psa_import_key( target, source->type, buffer, length );
|
||||
|
||||
exit:
|
||||
mbedtls_platform_zeroize( buffer, buffer_size );
|
||||
if( buffer_size != 0 )
|
||||
mbedtls_platform_zeroize( buffer, buffer_size );
|
||||
mbedtls_free( buffer );
|
||||
return( status );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue