From 4361d1bdd22e5a28ba3dbeb10c464dfc00a06c6d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 17 Feb 2022 08:47:50 -0800 Subject: [PATCH] SILABS port: fix sizeof A sizeof wasn't dereferencing a pointer using the sizeof the pointer and not the actual struct. This is limited to setting the key for an AES operation only when using SILABS SE2 acceleration. --- wolfcrypt/src/port/silabs/silabs_aes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/port/silabs/silabs_aes.c b/wolfcrypt/src/port/silabs/silabs_aes.c index 2177a58e6..ccc759b4d 100644 --- a/wolfcrypt/src/port/silabs/silabs_aes.c +++ b/wolfcrypt/src/port/silabs/silabs_aes.c @@ -48,7 +48,7 @@ int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen, return BUFFER_E; } - XMEMSET(aes, 0, sizeof(aes)); + XMEMSET(aes, 0, sizeof(*aes)); if (keylen > sizeof(aes->key)) { return BAD_FUNC_ARG;