diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 2f4fbe97f..1fc5bf584 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -2813,7 +2813,7 @@ static int wc_PKCS7_GenerateIV(WC_RNG* rng, byte* iv, word32 ivSz) return BAD_FUNC_ARG; /* input RNG is optional, init local one if input rng is NULL */ - if (rnd == NULL) { + if (rng == NULL) { rnd = (WC_RNG*)XMALLOC(sizeof(WC_RNG), NULL, DYNAMIC_TYPE_RNG); if (rnd == NULL) return MEMORY_E;