summaryrefslogtreecommitdiffstats
path: root/crypto/asn1
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-11 15:41:54 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-08-24 11:19:28 +1000
commite499a64befa50bc2e7b9cb3173e8ac9b402fe1f9 (patch)
tree3636a72874e5115669a804995a27c68d475ecb06 /crypto/asn1
parentab7f4a3d2b86ef564081df7219301f7874c4d8af (diff)
Fix coverity CID #1465531 - Negative return passed to a function param using size_t in asn1_item_digest_with_libctx()
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12628)
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/a_digest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asn1/a_digest.c b/crypto/asn1/a_digest.c
index 3e7b418a19..9211d7a968 100644
--- a/crypto/asn1/a_digest.c
+++ b/crypto/asn1/a_digest.c
@@ -63,7 +63,7 @@ int asn1_item_digest_with_libctx(const ASN1_ITEM *it, const EVP_MD *md,
EVP_MD *fetched_md = (EVP_MD *)md;
i = ASN1_item_i2d(asn, &str, it);
- if (str == NULL)
+ if (i < 0 || str == NULL)
return 0;
if (EVP_MD_provider(md) == NULL) {