[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Fri Mar 30 16:54:07 UTC 2018


The branch master has been updated
       via  6714cb1462c4980330e4cc4f65d7c10bc36b369d (commit)
      from  a73d990e2b6b1a406b1c85837a176bf7525d3914 (commit)


- Log -----------------------------------------------------------------
commit 6714cb1462c4980330e4cc4f65d7c10bc36b369d
Author: Rich Salz <rsalz at openssl.org>
Date:   Fri Mar 30 12:40:08 2018 -0400

    Remove some code
    
    This commit removes the contribution of a user that we cannot
    trace to gain their consent for the licence change.
    
    I also cleaned up the return/error-return flow a bit.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
    (Merged from https://github.com/openssl/openssl/pull/5811)

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

Summary of changes:
 crypto/pem/pem_lib.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c
index 26b4bc8..8300992 100644
--- a/crypto/pem/pem_lib.c
+++ b/crypto/pem/pem_lib.c
@@ -610,6 +610,7 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
     unsigned char *buf = NULL;
     EVP_ENCODE_CTX *ctx = EVP_ENCODE_CTX_new();
     int reason = ERR_R_BUF_LIB;
+    int retval = 0;
 
     if (ctx == NULL) {
         reason = ERR_R_MALLOC_FAILURE;
@@ -654,14 +655,14 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header,
         (BIO_write(bp, name, nlen) != nlen) ||
         (BIO_write(bp, "-----\n", 6) != 6))
         goto err;
-    OPENSSL_clear_free(buf, PEM_BUFSIZE * 8);
-    EVP_ENCODE_CTX_free(ctx);
-    return i + outl;
+    retval = i + outl;
+
  err:
-    OPENSSL_clear_free(buf, PEM_BUFSIZE * 8);
+    if (retval == 0)
+        PEMerr(PEM_F_PEM_WRITE_BIO, reason);
     EVP_ENCODE_CTX_free(ctx);
-    PEMerr(PEM_F_PEM_WRITE_BIO, reason);
-    return 0;
+    OPENSSL_free(buf);
+    return retval;
 }
 
 #ifndef OPENSSL_NO_STDIO


More information about the openssl-commits mailing list