Skip to content

Commit ff80d62

Browse files
Merge pull request #8942 from rlm2002/coverity
Coverity: address unresolved issue from previous change
2 parents 33510ad + c06fa48 commit ff80d62

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/ssl_p7p12.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ PKCS7* wolfSSL_d2i_PKCS7_bio(WOLFSSL_BIO* bio, PKCS7** p7)
317317
return NULL;
318318

319319
pkcs7->len = wolfSSL_BIO_get_len(bio);
320+
if (pkcs7->len < 0){
321+
wolfSSL_PKCS7_free((PKCS7*)pkcs7);
322+
return NULL;
323+
}
320324
pkcs7->data = (byte*)XMALLOC(pkcs7->len, NULL, DYNAMIC_TYPE_PKCS7);
321325
if (pkcs7->data == NULL) {
322326
wolfSSL_PKCS7_free((PKCS7*)pkcs7);

0 commit comments

Comments
 (0)