diff options
author | Nils Larsch <nils@openssl.org> | 2007-04-04 19:41:20 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2007-04-04 19:41:20 +0000 |
commit | 907e99623c7f9aefa7c89a33fd7187f182adc09a (patch) | |
tree | 7c4a19d75e264d203c7125563aa9d24b3465b6f6 | |
parent | 231671b9ffcf1f2dd50bdfa45f52eafdd714fb35 (diff) |
check return value of ASN1_item_i2d(), Coverity ID 55
-rw-r--r-- | crypto/pkcs7/pk7_doit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 37e35e1677..7eb053a656 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -1056,6 +1056,12 @@ for (ii=0; ii<md_len; ii++) printf("%02X",md_dat[ii]); printf(" calc\n"); alen = ASN1_item_i2d((ASN1_VALUE *)sk, &abuf, ASN1_ITEM_rptr(PKCS7_ATTR_VERIFY)); + if (alen <= 0) + { + PKCS7err(PKCS7_F_PKCS7_SIGNATUREVERIFY,ERR_R_ASN1_LIB); + ret = -1; + goto err; + } EVP_VerifyUpdate(&mdc_tmp, abuf, alen); OPENSSL_free(abuf); |