[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Rich Salz rsalz at openssl.org
Sat May 2 11:55:26 UTC 2015


The branch OpenSSL_1_0_2-stable has been updated
       via  5b38d54753acdabbf6b1d5e15d38ee81fb0612a2 (commit)
      from  6b3a315003f362150fddf8db072d4309f3f0d962 (commit)


- Log -----------------------------------------------------------------
commit 5b38d54753acdabbf6b1d5e15d38ee81fb0612a2
Author: Rich Salz <rsalz at akamai.com>
Date:   Fri May 1 22:06:07 2015 -0400

    RT3776: Wrong size for malloc
    
    Use sizeof *foo parameter, to avoid these errors.
    
    Reviewed-by: Viktor Dukhovni <viktor at openssl.org>
    (cherry picked from commit 53ba0a9e91ad203de2943edaf1090ab17ec435fa)

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

Summary of changes:
 crypto/x509/x509_vpm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c
index 9f7647f..ad5c9e8 100644
--- a/crypto/x509/x509_vpm.c
+++ b/crypto/x509/x509_vpm.c
@@ -172,16 +172,17 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
 {
     X509_VERIFY_PARAM *param;
     X509_VERIFY_PARAM_ID *paramid;
-    param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
+
+    param = OPENSSL_malloc(sizeof *param);
     if (!param)
         return NULL;
-    paramid = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
+    paramid = OPENSSL_malloc(sizeof *paramid);
     if (!paramid) {
         OPENSSL_free(param);
         return NULL;
     }
-    memset(param, 0, sizeof(X509_VERIFY_PARAM));
-    memset(paramid, 0, sizeof(X509_VERIFY_PARAM_ID));
+    memset(param, 0, sizeof *paramid);
+    memset(paramid, 0, sizeof *paramid);
     param->id = paramid;
     x509_verify_param_zero(param);
     return param;


More information about the openssl-commits mailing list