diff options
author | Pauli <paul.dale@oracle.com> | 2019-07-14 17:55:15 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-07-12 05:41:48 +1000 |
commit | 35e264c03232c7843733caa80f8e16bef7e2e829 (patch) | |
tree | 7233135ebc8dde2ca5113cfdfdacc6b268c69b08 /crypto/asn1 | |
parent | b481fbe68b8d561012a611bd6f46b0c8aa8fcbaa (diff) | |
download | openssl-new-35e264c03232c7843733caa80f8e16bef7e2e829.tar.gz |
Coverity #1451596: check dirlen for being negative
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9362)
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/bio_ndef.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/asn1/bio_ndef.c b/crypto/asn1/bio_ndef.c index d3be967f04..db9bbba940 100644 --- a/crypto/asn1/bio_ndef.c +++ b/crypto/asn1/bio_ndef.c @@ -184,6 +184,8 @@ static int ndef_suffix(BIO *b, unsigned char **pbuf, int *plen, void *parg) return 0; derlen = ASN1_item_ndef_i2d(ndef_aux->val, NULL, ndef_aux->it); + if (derlen < 0) + return 0; if ((p = OPENSSL_malloc(derlen)) == NULL) { ASN1err(ASN1_F_NDEF_SUFFIX, ERR_R_MALLOC_FAILURE); return 0; |