[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Andy Polyakov appro at openssl.org
Mon Apr 9 20:35:35 UTC 2018

The branch OpenSSL_1_1_0-stable has been updated
       via  ca1beab7c11f0fe5e2717adc85fcf4ee8a9b4ae1 (commit)
      from  d78cecd0c0275268726cb34defd3ccc6ab124396 (commit)

- Log -----------------------------------------------------------------
commit ca1beab7c11f0fe5e2717adc85fcf4ee8a9b4ae1
Author: Andy Polyakov <appro at openssl.org>
Date:   Fri Apr 6 14:33:30 2018 +0200

    bio/b_addr.c: resolve HP-UX compiler warnings.
    The warning reads "[cast] may cause misaligned access". Even though
    this can be application-supplied pointer, misaligned access shouldn't
    happen, because structure type is "encoded" into data itself, and
    application would customarily pass correctly aligned pointer. But
    there is no harm in resolving the warning...
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5894)
    (cherry picked from commit 55bd917bc4213bc668f48b87d8c6feb9918fef8f)


Summary of changes:
 crypto/bio/b_addr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index aea843a..24097d7 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -66,18 +66,18 @@ void BIO_ADDR_clear(BIO_ADDR *ap)
 int BIO_ADDR_make(BIO_ADDR *ap, const struct sockaddr *sa)
     if (sa->sa_family == AF_INET) {
-        ap->s_in = *(const struct sockaddr_in *)sa;
+        memcpy(&(ap->s_in), sa, sizeof(struct sockaddr_in));
         return 1;
 #ifdef AF_INET6
     if (sa->sa_family == AF_INET6) {
-        ap->s_in6 = *(const struct sockaddr_in6 *)sa;
+        memcpy(&(ap->s_in6), sa, sizeof(struct sockaddr_in6));
         return 1;
 #ifdef AF_UNIX
     if (sa->sa_family == AF_UNIX) {
-        ap->s_un = *(const struct sockaddr_un *)sa;
+        memcpy(&(ap->s_un), sa, sizeof(struct sockaddr_un));
         return 1;

More information about the openssl-commits mailing list