From a2b2ce124e7056cccf8ca94b09178335ce6f8548 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 26 Oct 2018 13:53:41 -0600 Subject: [PATCH] add a check to help out static analysis tool --- wolfcrypt/src/pkcs7.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 255824745..c159d63ee 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -9006,6 +9006,11 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* in, } wc_PKCS7_StreamGetVar(pkcs7, 0, 0, &length); tmpIv = pkcs7->stream->tmpIv; + if (tmpIv == NULL) { + /* check added to help out static analysis tool */ + ret = MEMORY_E; + break; + } #endif XMEMCPY(tmpIv, &pkiMsg[idx], length);