]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Correct "//" in search paths due to LD_AT_PLATFORM=""
authorRyan S. Arnold <rsa@us.ibm.com>
Wed, 25 May 2011 16:11:25 +0000 (11:11 -0500)
committerRyan S. Arnold <rsa@us.ibm.com>
Wed, 25 May 2011 16:11:25 +0000 (11:11 -0500)
ChangeLog
sysdeps/unix/sysv/linux/powerpc/dl-librecon.h

index 37438bbd9598e986b3f34a258c13917d48c76ced..f172c0d46561553be00585ebb25119b0ef832101 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-25  Ryan S. Arnold  <rsa@us.ibm.com>
+
+       * sysdeps/unix/sysv/linux/powerpc/dl-librecon.h
+       (EXTRA_LD_ENVVARS_11): Fix condition where there's an extra slash in
+       the search path, i.e., "//" when LD_AT_PLATFORM= or
+       LD_AT_PLATFORM="".
+       (EXTRA_UNSECURE_ENVVARS): Add LD_AT_PLATFORM to the list.
+
 2011-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        * stdio-common/printf-parsemb.c (__parse_one_specmb): Handle
index 19dafac63ea5ecbc0df60be3965637dd1a1de627..19c3da7cfb21216cfcd4847237e32564e27d6fcf 100644 (file)
@@ -1,5 +1,5 @@
 /* Optional code to distinguish library flavours.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Peter Bergner <bergner@linux.vnet.ibm.com>
 
 
 #ifndef _DL_LIBRECON_H
 
+#include <string.h>
 #include <sysdeps/unix/sysv/linux/dl-librecon.h>
 
 /* Recognizing extra environment variables.  */
 #define EXTRA_LD_ENVVARS_11 \
   if (memcmp (envline, "AT_PLATFORM", 11) == 0)                                      \
     {                                                                        \
-      GLRO(dl_platform) = &envline[12];                                              \
-      /* Determine the length of the platform name.  */                              \
-      if (GLRO(dl_platform) != NULL)                                         \
-        GLRO(dl_platformlen) = strlen (GLRO(dl_platform));                   \
+      int platformlen = strlen (&envline[12]);                               \
+      GLRO(dl_platformlen) = platformlen;                                    \
+      if (platformlen > 0)                                                   \
+       {                                                                     \
+         GLRO(dl_platform) = &envline[12];                                   \
+         break;                                                              \
+       }                                                                     \
+      GLRO(dl_platform) = NULL;                                                      \
       break;                                                                 \
     }
 
+/* Extra unsecure variables.  The names are all stuffed in a single
+   string which means they have to be terminated with a '\0' explicitly.  */
+#define EXTRA_UNSECURE_ENVVARS \
+  "LD_AT_PLATFORM\0"
+
 #endif /* dl-librecon.h */