[openssl] master update
shane.lontis at oracle.com
shane.lontis at oracle.com
Tue Aug 4 02:35:47 UTC 2020
The branch master has been updated
via 19b4e6f8feba9aeec5d4e0d0aacb11d143b59340 (commit)
from e5b2cd5899b2631363740a40c76d96fd15d32d1c (commit)
- Log -----------------------------------------------------------------
commit 19b4e6f8feba9aeec5d4e0d0aacb11d143b59340
Author: Norman Ashley <nashley at cisco.com>
Date: Tue Aug 4 12:34:22 2020 +1000
Coverity Fixes for issue #12531
Fixes #12531 on master branch.
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12557)
-----------------------------------------------------------------------
Summary of changes:
crypto/asn1/x_algor.c | 7 ++++++-
crypto/cms/cms_lib.c | 4 ++--
crypto/x509/pcy_data.c | 1 +
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c
index 70f2615026..f29d26d91c 100644
--- a/crypto/asn1/x_algor.c
+++ b/crypto/asn1/x_algor.c
@@ -110,13 +110,18 @@ int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src)
if ((dest->algorithm = OBJ_dup(src->algorithm)) == NULL)
return 0;
- if (src->parameter)
+ if (src->parameter != NULL) {
+ dest->parameter = ASN1_TYPE_new();
+ if (dest->parameter == NULL)
+ return 0;
+
/* Assuming this is also correct for a BOOL.
* set does copy as a side effect.
*/
if (ASN1_TYPE_set1(dest->parameter,
src->parameter->type, src->parameter->value.ptr) == 0)
return 0;
+ }
return 1;
}
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c
index 67f4fbb4ea..6e2a20c4b3 100644
--- a/crypto/cms/cms_lib.c
+++ b/crypto/cms/cms_lib.c
@@ -97,12 +97,12 @@ BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont)
default:
CMSerr(CMS_F_CMS_DATAINIT, CMS_R_UNSUPPORTED_TYPE);
- return NULL;
+ goto err;
}
if (cmsbio)
return BIO_push(cmsbio, cont);
-
+err:
if (!icont)
BIO_free(cont);
return NULL;
diff --git a/crypto/x509/pcy_data.c b/crypto/x509/pcy_data.c
index 966b0b2ecb..6b509cf457 100644
--- a/crypto/x509/pcy_data.c
+++ b/crypto/x509/pcy_data.c
@@ -54,6 +54,7 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy,
id = NULL;
ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
+ ASN1_OBJECT_free(id);
X509V3err(X509V3_F_POLICY_DATA_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
More information about the openssl-commits
mailing list