[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Sat Apr 14 11:29:41 UTC 2018


The branch master has been updated
       via  d47eb76cd5fef2495c23705733d7034370063556 (commit)
      from  560096f804a3712eea161726a8f085beefe8838a (commit)


- Log -----------------------------------------------------------------
commit d47eb76cd5fef2495c23705733d7034370063556
Author: Matthias Kraft <Matthias.Kraft at softwareag.com>
Date:   Thu Apr 12 12:25:27 2018 +0200

    openssl#5668: corrections after compiling with -qinfo=all:als.
    
    The ongoing discussion about casting or not in PR #5626 had me compiling
    again with above mentioned flags. Indeed the compiler had to say something
    about it and I did these changes to silence it again.
    
    Reviewed-by: Bernd Edlinger <bernd.edlinger at hotmail.de>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5943)

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

Summary of changes:
 crypto/dso/dso_dlfcn.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index 7abfe66..21bfb3b 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -326,8 +326,9 @@ typedef struct Dl_info {
  * address of a function, which is just located in the DATA segment instead of
  * the TEXT segment.
  */
-static int dladdr(void *addr, Dl_info *dl)
+static int dladdr(void *ptr, Dl_info *dl)
 {
+    uintptr_t addr = (uintptr_t)ptr;
     unsigned int found = 0;
     struct ld_info *ldinfos, *next_ldi, *this_ldi;
 
@@ -352,11 +353,12 @@ static int dladdr(void *addr, Dl_info *dl)
 
     do {
         this_ldi = next_ldi;
-        if (((addr >= this_ldi->ldinfo_textorg)
-             && (addr < (this_ldi->ldinfo_textorg + this_ldi->ldinfo_textsize)))
-            || ((addr >= this_ldi->ldinfo_dataorg)
-                && (addr <
-                    (this_ldi->ldinfo_dataorg + this_ldi->ldinfo_datasize)))) {
+        if (((addr >= (uintptr_t)this_ldi->ldinfo_textorg)
+             && (addr < ((uintptr_t)this_ldi->ldinfo_textorg +
+                         this_ldi->ldinfo_textsize)))
+            || ((addr >= (uintptr_t)this_ldi->ldinfo_dataorg)
+                && (addr < ((uintptr_t)this_ldi->ldinfo_dataorg +
+                            this_ldi->ldinfo_datasize)))) {
             found = 1;
             /*
              * Ignoring the possibility of a member name and just returning
@@ -367,7 +369,8 @@ static int dladdr(void *addr, Dl_info *dl)
                  OPENSSL_strdup(this_ldi->ldinfo_filename)) == NULL)
                 errno = ENOMEM;
         } else {
-            next_ldi = (char *)this_ldi + this_ldi->ldinfo_next;
+            next_ldi =
+                (struct ld_info *)((uintptr_t)this_ldi + this_ldi->ldinfo_next);
         }
     } while (this_ldi->ldinfo_next && !found);
     OPENSSL_free((void *)ldinfos);
@@ -395,7 +398,7 @@ static int dlfcn_pathbyaddr(void *addr, char *path, int sz)
         len = (int)strlen(dli.dli_fname);
         if (sz <= 0) {
 #  ifdef _AIX
-            OPENSSL_free(dli.dli_fname);
+            OPENSSL_free((void *)dli.dli_fname);
 #  endif
             return len + 1;
         }
@@ -404,7 +407,7 @@ static int dlfcn_pathbyaddr(void *addr, char *path, int sz)
         memcpy(path, dli.dli_fname, len);
         path[len++] = 0;
 #  ifdef _AIX
-        OPENSSL_free(dli.dli_fname);
+        OPENSSL_free((void *)dli.dli_fname);
 #  endif
         return len;
     }


More information about the openssl-commits mailing list