commit | 480347d682bb31bd75e1fbf6ab00c7a5707fdfa1 | [log] [tgz] |
---|---|---|
author | Thomas Daubney <thomas.daubney@arm.com> | Thu Feb 01 19:00:26 2024 +0000 |
committer | Thomas Daubney <thomas.daubney@arm.com> | Mon Feb 12 12:21:46 2024 +0000 |
tree | 2511f029dde0fa7f7d7aa3f32d04d2461af16bfd | |
parent | 301491d70c7f9916cf930f8021bd12811a9129c0 [diff] [blame] |
Add mac not NULL check before calling memset Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c index b698912..9090924 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c
@@ -2687,7 +2687,7 @@ operation->mac_size = 0; } - if (mac_size > operation->mac_size) { + if ((mac != NULL) && (mac_size > operation->mac_size)) { memset(&mac[operation->mac_size], '!', mac_size - operation->mac_size); }