[openssl-commits] [openssl] master update

Matt Caswell matt at openssl.org
Mon May 9 08:08:29 UTC 2016


The branch master has been updated
       via  e0d32e98f00cfd39977593ae1bc6cfd2ab6bbb0e (commit)
       via  cb1d435cac2a9a7bd6019f9f23648c8075251109 (commit)
      from  5cf14ce074dfd1780ae4c68b2e7f083bfaf47530 (commit)


- Log -----------------------------------------------------------------
commit e0d32e98f00cfd39977593ae1bc6cfd2ab6bbb0e
Author: J Mohan Rao Arisankala <mohan at barracuda.com>
Date:   Fri May 6 07:05:44 2016 +0530

    fix check
    
    Reviewed-by: Kurt Roeckx <kurt at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>

commit cb1d435cac2a9a7bd6019f9f23648c8075251109
Author: J Mohan Rao Arisankala <mohan at barracuda.com>
Date:   Thu May 5 23:43:32 2016 +0530

    few missing allocation failure checks and releases on error paths
    
    - Missing checks for allocation failure.
    - releasing memory in few missing error paths
    
    Reviewed-by: Kurt Roeckx <kurt at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>

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

Summary of changes:
 crypto/bio/b_addr.c   | 4 +++-
 crypto/bio/bio_err.c  | 8 ++------
 crypto/ec/ec_kmeth.c  | 1 +
 crypto/evp/bio_b64.c  | 7 ++++++-
 crypto/evp/bio_ok.c   | 4 ++++
 include/openssl/bio.h | 7 ++++---
 6 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index 86c6c7e..1813f5a 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -83,8 +83,10 @@ BIO_ADDR *BIO_ADDR_new(void)
 {
     BIO_ADDR *ret = OPENSSL_zalloc(sizeof(*ret));
 
-    if (ret == NULL)
+    if (ret == NULL) {
+        BIOerr(BIO_F_BIO_ADDR_NEW, ERR_R_MALLOC_FAILURE);
         return NULL;
+    }
 
     ret->sa.sa_family = AF_UNSPEC;
     return ret;
diff --git a/crypto/bio/bio_err.c b/crypto/bio/bio_err.c
index 6bf1df6..e4b74ad 100644
--- a/crypto/bio/bio_err.c
+++ b/crypto/bio/bio_err.c
@@ -1,16 +1,11 @@
 /*
+ * Generated by util/mkerr.pl DO NOT EDIT
  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
-*/
-
-/*
- * NOTE: this file was auto generated by the mkerr.pl script: any changes
- * made to it will be overwritten when the script next updates this file,
- * only reason strings will be preserved.
  */
 
 #include <stdio.h>
@@ -28,6 +23,7 @@ static ERR_STRING_DATA BIO_str_functs[] = {
     {ERR_FUNC(BIO_F_ADDR_STRINGS), "addr_strings"},
     {ERR_FUNC(BIO_F_BIO_ACCEPT), "BIO_accept"},
     {ERR_FUNC(BIO_F_BIO_ACCEPT_EX), "BIO_accept_ex"},
+    {ERR_FUNC(BIO_F_BIO_ADDR_NEW), "BIO_ADDR_new"},
     {ERR_FUNC(BIO_F_BIO_BER_GET_HEADER), "BIO_BER_GET_HEADER"},
     {ERR_FUNC(BIO_F_BIO_CALLBACK_CTRL), "BIO_callback_ctrl"},
     {ERR_FUNC(BIO_F_BIO_CONNECT), "BIO_connect"},
diff --git a/crypto/ec/ec_kmeth.c b/crypto/ec/ec_kmeth.c
index 003421e..75e58d5 100644
--- a/crypto/ec/ec_kmeth.c
+++ b/crypto/ec/ec_kmeth.c
@@ -166,6 +166,7 @@ EC_KEY *EC_KEY_new_method(ENGINE *engine)
     ret->references = 1;
 
     if (ret->meth->init != NULL && ret->meth->init(ret) == 0) {
+        ECerr(EC_F_EC_KEY_NEW_METHOD, ERR_R_INIT_FAIL);
         EC_KEY_free(ret);
         return NULL;
     }
diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c
index cdb50b4..76fe9e3 100644
--- a/crypto/evp/bio_b64.c
+++ b/crypto/evp/bio_b64.c
@@ -118,11 +118,16 @@ static int b64_new(BIO *bi)
 
     ctx = OPENSSL_zalloc(sizeof(*ctx));
     if (ctx == NULL)
-        return (0);
+        return 0;
 
     ctx->cont = 1;
     ctx->start = 1;
     ctx->base64 = EVP_ENCODE_CTX_new();
+    if (ctx->base64 == NULL) {
+        OPENSSL_free(ctx);
+        return 0;
+    }
+
     BIO_set_data(bi, ctx);
     BIO_set_init(bi, 1);
 
diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c
index 0ac1a31..65577c0 100644
--- a/crypto/evp/bio_ok.c
+++ b/crypto/evp/bio_ok.c
@@ -183,6 +183,10 @@ static int ok_new(BIO *bi)
     ctx->cont = 1;
     ctx->sigio = 1;
     ctx->md = EVP_MD_CTX_new();
+    if (ctx->md == NULL) {
+        OPENSSL_free(ctx);
+        return 0;
+    }
     BIO_set_init(bi, 0);
     BIO_set_data(bi, ctx);
 
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index 03a6f04..f98f6ee 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -809,12 +809,12 @@ int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
                                                       bio_info_cb *));
 
 /* BEGIN ERROR CODES */
+
 /*
- * The following lines are auto generated by the script mkerr.pl. Any changes
- * made after this point may be overwritten when the script is next run.
+ * Content after this point is generated by util/mkerr.pl
+ * DO NOT EDIT!
  */
 void ERR_load_BIO_strings(void);
-
 /* Error codes for the BIO functions. */
 
 /* Function codes. */
@@ -822,6 +822,7 @@ void ERR_load_BIO_strings(void);
 # define BIO_F_ADDR_STRINGS                               134
 # define BIO_F_BIO_ACCEPT                                 101
 # define BIO_F_BIO_ACCEPT_EX                              137
+# define BIO_F_BIO_ADDR_NEW                               144
 # define BIO_F_BIO_BER_GET_HEADER                         102
 # define BIO_F_BIO_CALLBACK_CTRL                          131
 # define BIO_F_BIO_CONNECT                                138


More information about the openssl-commits mailing list