This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-1054-gdbba87d


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  dbba87d531ad3ea372eba6cb56436a231ca7fb32 (commit)
      from  66ac23dec2373bc4188bc8801280545316a63267 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=dbba87d531ad3ea372eba6cb56436a231ca7fb32

commit dbba87d531ad3ea372eba6cb56436a231ca7fb32
Author: Dmitry V. Levin <ldv@altlinux.org>
Date:   Wed Dec 27 22:12:51 2017 +0000

    elf: check for rpath emptiness before making a copy of it
    
    * elf/dl-load.c (decompose_rpath): Check for rpath emptiness before
    making a copy of it.

diff --git a/ChangeLog b/ChangeLog
index 22a4a9f..1dd4b86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-01  Dmitry V. Levin  <ldv@altlinux.org>
+
+	* elf/dl-load.c (decompose_rpath): Check for rpath emptiness before
+	making a copy of it.
+
 2018-01-01  Joseph Myers  <joseph@codesourcery.com>
 
 	* manual/texinfo.tex: Update to version 2017-12-26.21 with
diff --git a/elf/dl-load.c b/elf/dl-load.c
index d9ec49d..7554a99 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -499,7 +499,6 @@ decompose_rpath (struct r_search_path_struct *sps,
 {
   /* Make a copy we can work with.  */
   const char *where = l->l_name;
-  char *copy;
   char *cp;
   struct r_search_path_elem **result;
   size_t nelems;
@@ -538,22 +537,21 @@ decompose_rpath (struct r_search_path_struct *sps,
       while (*inhp != '\0');
     }
 
+  /* Ignore empty rpaths.  */
+  if (*rpath == '\0')
+    {
+      sps->dirs = (struct r_search_path_elem **) -1;
+      return false;
+    }
+
   /* Make a writable copy.  */
-  copy = __strdup (rpath);
+  char *copy = __strdup (rpath);
   if (copy == NULL)
     {
       errstring = N_("cannot create RUNPATH/RPATH copy");
       goto signal_error;
     }
 
-  /* Ignore empty rpaths.  */
-  if (*copy == 0)
-    {
-      free (copy);
-      sps->dirs = (struct r_search_path_elem **) -1;
-      return false;
-    }
-
   /* Count the number of necessary elements in the result array.  */
   nelems = 0;
   for (cp = copy; *cp != '\0'; ++cp)

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

Summary of changes:
 ChangeLog     |    5 +++++
 elf/dl-load.c |   18 ++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]