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 {