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;