Add mac not NULL check before calling memset

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
Thomas Daubney 2024-02-01 19:00:26 +00:00
parent 301491d70c
commit 480347d682

View File

@ -2687,7 +2687,7 @@ exit:
operation->mac_size = 0; operation->mac_size = 0;
} }
if (mac_size > operation->mac_size) { if ((mac != NULL) && (mac_size > operation->mac_size)) {
memset(&mac[operation->mac_size], '!', memset(&mac[operation->mac_size], '!',
mac_size - operation->mac_size); mac_size - operation->mac_size);
} }