[openssl] master update

Dr. Paul Dale pauli at openssl.org
Tue Jan 7 04:03:48 UTC 2020


The branch master has been updated
       via  5310a4e616f9f0268048c6a8c4dec4cf2c493bb8 (commit)
       via  756f5c6c7cc97b4cc3b9872e06967c667448511d (commit)
      from  1242f3c798db340397186e178023f1a9fe297df0 (commit)


- Log -----------------------------------------------------------------
commit 5310a4e616f9f0268048c6a8c4dec4cf2c493bb8
Author: Pauli <paul.dale at oracle.com>
Date:   Mon Jan 6 11:23:21 2020 +1000

    coverity 1201462: check error returns
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/10760)

commit 756f5c6c7cc97b4cc3b9872e06967c667448511d
Author: Pauli <paul.dale at oracle.com>
Date:   Mon Jan 6 11:21:14 2020 +1000

    coverity 1201478: check BIO_indent returns
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/10760)

-----------------------------------------------------------------------

Summary of changes:
 crypto/dh/dh_ameth.c | 16 +++++++++-------
 crypto/evp/p_lib.c   |  7 +++----
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index 7907f50192..174bd04cef 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -295,8 +295,8 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, int ptype)
     else
         ktype = "DH Parameters";
 
-    BIO_indent(bp, indent, 128);
-    if (BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0)
+    if (!BIO_indent(bp, indent, 128)
+            || BIO_printf(bp, "%s: (%d bit)\n", ktype, BN_num_bits(x->p)) <= 0)
         goto err;
     indent += 4;
 
@@ -315,8 +315,10 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, int ptype)
         goto err;
     if (x->seed) {
         int i;
-        BIO_indent(bp, indent, 128);
-        BIO_puts(bp, "seed:");
+
+        if (!BIO_indent(bp, indent, 128)
+                || BIO_puts(bp, "seed:") <= 0)
+            goto err;
         for (i = 0; i < x->seedlen; i++) {
             if ((i % 15) == 0) {
                 if (BIO_puts(bp, "\n") <= 0
@@ -333,9 +335,9 @@ static int do_dh_print(BIO *bp, const DH *x, int indent, int ptype)
     if (x->counter && !ASN1_bn_print(bp, "counter:", x->counter, NULL, indent))
         goto err;
     if (x->length != 0) {
-        BIO_indent(bp, indent, 128);
-        if (BIO_printf(bp, "recommended-private-length: %d bits\n",
-                       (int)x->length) <= 0)
+        if (!BIO_indent(bp, indent, 128)
+                || BIO_printf(bp, "recommended-private-length: %d bits\n",
+                              (int)x->length) <= 0)
             goto err;
     }
 
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 9999636cfd..59cadb4aad 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -694,10 +694,9 @@ static int print_set_indent(BIO **out, int *pop_f_prefix, long *saved_indent,
 static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent,
                      const char *kstr)
 {
-    BIO_indent(out, indent, 128);
-    BIO_printf(out, "%s algorithm \"%s\" unsupported\n",
-               kstr, OBJ_nid2ln(pkey->type));
-    return 1;
+    return BIO_indent(out, indent, 128)
+        && BIO_printf(out, "%s algorithm \"%s\" unsupported\n",
+                      kstr, OBJ_nid2ln(pkey->type)) > 0;
 }
 
 static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent,


More information about the openssl-commits mailing list