[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
bernd.edlinger at hotmail.de
bernd.edlinger at hotmail.de
Fri Nov 3 15:07:21 UTC 2017
The branch OpenSSL_1_1_0-stable has been updated
via bf37a9f58cd9b60c0397cb0a4c56d20b157a889c (commit)
from 64adaa3fa6d1a2c961707308bee1230436076756 (commit)
- Log -----------------------------------------------------------------
commit bf37a9f58cd9b60c0397cb0a4c56d20b157a889c
Author: Pavel Kopyl <p.kopyl at samsung.com>
Date: Fri Oct 27 16:13:11 2017 +0300
Add error handling in dsa_main and ASN1_i2d_bio.
CLA: trivial
Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/4600)
(cherry picked from commit a6f622bc99ffdc7b34199babb9d200b24a7a6431)
-----------------------------------------------------------------------
Summary of changes:
apps/dsa.c | 3 +++
crypto/asn1/a_i2d_fp.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/apps/dsa.c b/apps/dsa.c
index 9c93549..8454b2e 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -217,6 +217,9 @@ int dsa_main(int argc, char **argv)
} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
EVP_PKEY *pk;
pk = EVP_PKEY_new();
+ if (pk == NULL)
+ goto end;
+
EVP_PKEY_set1_DSA(pk, dsa);
if (outformat == FORMAT_PVK) {
if (pubin) {
diff --git a/crypto/asn1/a_i2d_fp.c b/crypto/asn1/a_i2d_fp.c
index 1514ede..3b3f713 100644
--- a/crypto/asn1/a_i2d_fp.c
+++ b/crypto/asn1/a_i2d_fp.c
@@ -38,6 +38,9 @@ int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x)
int i, j = 0, n, ret = 1;
n = i2d(x, NULL);
+ if (n <= 0)
+ return 0;
+
b = OPENSSL_malloc(n);
if (b == NULL) {
ASN1err(ASN1_F_ASN1_I2D_BIO, ERR_R_MALLOC_FAILURE);
More information about the openssl-commits
mailing list