mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Do not attempt to wipe output buffer if it is NULL
If the output buffer is NULL, it either: * Does not need wiping because it is zero-length. * Has failed allocation of a copy. * Has not yet been written to as a copy hasn't been allocated. In any of these circumstances, we should not try to write the buffer, so perform a NULL check before wiping it. Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@ -3658,8 +3658,10 @@ psa_status_t psa_sign_hash_complete(
|
||||
|
||||
exit:
|
||||
|
||||
psa_wipe_tag_output_buffer(signature, status, signature_size,
|
||||
*signature_length);
|
||||
if (signature != NULL) {
|
||||
psa_wipe_tag_output_buffer(signature, status, signature_size,
|
||||
*signature_length);
|
||||
}
|
||||
|
||||
if (status != PSA_OPERATION_INCOMPLETE) {
|
||||
if (status != PSA_SUCCESS) {
|
||||
|
Reference in New Issue
Block a user