forked from wolfSSL/wolfssl
scan-build warnings / fixes
This commit is contained in:
@@ -3668,7 +3668,7 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
|
|||||||
byte* in2, word32 in2Sz)
|
byte* in2, word32 in2Sz)
|
||||||
{
|
{
|
||||||
word32 idx, outerContentType, contentTypeSz = 0, totalSz = 0;
|
word32 idx, outerContentType, contentTypeSz = 0, totalSz = 0;
|
||||||
int length = 0, version, ret = 0;
|
int length = 0, version = 0, ret = 0;
|
||||||
byte* content = NULL;
|
byte* content = NULL;
|
||||||
byte* contentDynamic = NULL;
|
byte* contentDynamic = NULL;
|
||||||
byte* sig = NULL;
|
byte* sig = NULL;
|
||||||
@@ -11326,8 +11326,10 @@ int wc_PKCS7_DecodeEncryptedData(PKCS7* pkcs7, byte* in, word32 inSz,
|
|||||||
encOID = 0;
|
encOID = 0;
|
||||||
#endif
|
#endif
|
||||||
if (ret == 0 && (encryptedContent = (byte*)XMALLOC(
|
if (ret == 0 && (encryptedContent = (byte*)XMALLOC(
|
||||||
encryptedContentSz, pkcs7->heap, DYNAMIC_TYPE_PKCS7)) == NULL)
|
encryptedContentSz, pkcs7->heap, DYNAMIC_TYPE_PKCS7)) == NULL) {
|
||||||
ret = MEMORY_E;
|
ret = MEMORY_E;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
XMEMCPY(encryptedContent, &pkiMsg[idx], encryptedContentSz);
|
XMEMCPY(encryptedContent, &pkiMsg[idx], encryptedContentSz);
|
||||||
|
@@ -20829,6 +20829,10 @@ static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz,
|
|||||||
memset(keyIdRaw, 0, sizeof(keyIdRaw));
|
memset(keyIdRaw, 0, sizeof(keyIdRaw));
|
||||||
ret = wc_PKCS7_GetAttributeValue(pkcs7, OID, sizeof(OID), keyIdRaw,
|
ret = wc_PKCS7_GetAttributeValue(pkcs7, OID, sizeof(OID), keyIdRaw,
|
||||||
&keyIdSz);
|
&keyIdSz);
|
||||||
|
if (ret < 0) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (keyIdSz < 3) {
|
if (keyIdSz < 3) {
|
||||||
printf("keyIdSz is smaller than expected\n");
|
printf("keyIdSz is smaller than expected\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user