From f00e5247bb0cef3a9b66d4b8c833b3acaf2d8031 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Mon, 17 Jun 2024 11:49:41 -0400 Subject: [PATCH] Add sanity for case id'd in optesting review --- wolfcrypt/src/aes.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 7edf08f9f..915b22dbb 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -10643,6 +10643,11 @@ static WARN_UNUSED_RESULT int roll_auth( word32 remainder; int ret; + /* Sanity check on authIn to prevent segfault in xorbuf() where + * variable 'in' is dereferenced as the mask 'm' in misc.c */ + if (in == NULL) + return BAD_FUNC_ARG; + /* encode the length in */ if (inSz <= 0xFEFF) { authLenSz = 2;