diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-08-11 15:41:54 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-08-24 11:19:28 +1000 |
commit | e499a64befa50bc2e7b9cb3173e8ac9b402fe1f9 (patch) | |
tree | 3636a72874e5115669a804995a27c68d475ecb06 | |
parent | ab7f4a3d2b86ef564081df7219301f7874c4d8af (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)
-rw-r--r-- | crypto/asn1/a_digest.c | 2 |
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) { |