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

Rich Salz rsalz at openssl.org
Wed Mar 8 14:55:51 UTC 2017


The branch OpenSSL_1_0_2-stable has been updated
       via  178b9be8eccffca66434299bf986494c449b10ee (commit)
      from  5c09502be4821a36e7023f74223386f77c2b2d14 (commit)


- Log -----------------------------------------------------------------
commit 178b9be8eccffca66434299bf986494c449b10ee
Author: Roberto Guimaraes <rguimaraes at fastly.com>
Date:   Wed Mar 8 09:54:04 2017 -0500

    Prevent undefined behavior in memcpy call.
    
    CLA: trivial
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2750)
    (cherry picked from commit 6aad9393680ccde591905c8d71da92a241756394)

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

Summary of changes:
 ssl/ssl_sess.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index c3369a4..f50f514 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -1006,7 +1006,8 @@ int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
         return 0;
     }
     s->sid_ctx_length = sid_ctx_len;
-    memcpy(s->sid_ctx, sid_ctx, sid_ctx_len);
+    if (s->sid_ctx != sid_ctx)
+        memcpy(s->sid_ctx, sid_ctx, sid_ctx_len);
 
     return 1;
 }


More information about the openssl-commits mailing list