[openssl-commits] [openssl] master update

Ben Laurie ben at openssl.org
Sat May 7 17:28:44 UTC 2016


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


- Log -----------------------------------------------------------------
commit 5cf14ce074dfd1780ae4c68b2e7f083bfaf47530
Author: Ben Laurie <ben at links.org>
Date:   Wed May 4 11:45:49 2016 +0100

    memset() doesn't take NULL.
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>

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

Summary of changes:
 crypto/buffer/buffer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/crypto/buffer/buffer.c b/crypto/buffer/buffer.c
index a16f3bd..1c76d66 100644
--- a/crypto/buffer/buffer.c
+++ b/crypto/buffer/buffer.c
@@ -128,7 +128,8 @@ size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
         return (len);
     }
     if (str->max >= len) {
-        memset(&str->data[str->length], 0, len - str->length);
+        if (str->data != NULL)
+            memset(&str->data[str->length], 0, len - str->length);
         str->length = len;
         return (len);
     }
@@ -160,7 +161,8 @@ size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
     size_t n;
 
     if (str->length >= len) {
-        memset(&str->data[len], 0, str->length - len);
+        if (str->data != NULL)
+            memset(&str->data[len], 0, str->length - len);
         str->length = len;
         return (len);
     }


More information about the openssl-commits mailing list