From ed4b87eb37e5b6db821d55e64c1ab785d5eab82d Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 1 Feb 2024 14:26:13 -0700 Subject: [PATCH] fix for clang-tidy null dereference error --- wolfcrypt/src/asn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index c4e88b388..f29c990e6 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -15400,7 +15400,9 @@ word32 SetLength(word32 length, byte* output) word32 SetLengthEx(word32 length, byte* output, byte isIndef) { if (isIndef) { - output[0] = ASN_INDEF_LENGTH; + if (output != NULL) { + output[0] = ASN_INDEF_LENGTH; + } return 1; } else {