Blame SOURCES/glibc-rh1540480-7.patch

147e83
commit dbba87d531ad3ea372eba6cb56436a231ca7fb32
147e83
Author: Dmitry V. Levin <ldv@altlinux.org>
147e83
Date:   Wed Dec 27 22:12:51 2017 +0000
147e83
147e83
    elf: check for rpath emptiness before making a copy of it
147e83
147e83
    * elf/dl-load.c (decompose_rpath): Check for rpath emptiness before
147e83
    making a copy of it.
147e83
147e83
Index: glibc-2.17-c758a686/elf/dl-load.c
147e83
===================================================================
147e83
--- glibc-2.17-c758a686.orig/elf/dl-load.c
147e83
+++ glibc-2.17-c758a686/elf/dl-load.c
147e83
@@ -550,7 +550,6 @@ decompose_rpath (struct r_search_path_st
147e83
 {
147e83
   /* Make a copy we can work with.  */
147e83
   const char *where = l->l_name;
147e83
-  char *copy;
147e83
   char *cp;
147e83
   struct r_search_path_elem **result;
147e83
   size_t nelems;
147e83
@@ -589,22 +588,21 @@ decompose_rpath (struct r_search_path_st
147e83
       while (*inhp != '\0');
147e83
     }
147e83
 
147e83
+  /* Ignore empty rpaths.  */
147e83
+  if (*rpath == '\0')
147e83
+    {
147e83
+      sps->dirs = (struct r_search_path_elem **) -1;
147e83
+      return false;
147e83
+    }
147e83
+
147e83
   /* Make a writable copy.  */
147e83
-  copy = local_strdup (rpath);
147e83
+  char *copy = local_strdup (rpath);
147e83
   if (copy == NULL)
147e83
     {
147e83
       errstring = N_("cannot create RUNPATH/RPATH copy");
147e83
       goto signal_error;
147e83
     }
147e83
 
147e83
-  /* Ignore empty rpaths.  */
147e83
-  if (*copy == 0)
147e83
-    {
147e83
-      free (copy);
147e83
-      sps->dirs = (struct r_search_path_elem **) -1;
147e83
-      return false;
147e83
-    }
147e83
-
147e83
   /* Count the number of necessary elements in the result array.  */
147e83
   nelems = 0;
147e83
   for (cp = copy; *cp != '\0'; ++cp)