add a check to help out static analysis tool

pull/1898/head
Jacob Barthelmeh 2018-10-26 13:53:41 -06:00 committed by David Garske
parent afbf09b970
commit a2b2ce124e
1 changed files with 5 additions and 0 deletions

View File

@ -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);