Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 004fd25eb1d89e31fc9cddb571328f7f > files > 55

glibc-2.20-21.mga5.src.rpm

From: Bram <bug_rh@spam.wizbit.be>

---

This patch was submitted to BZ#15378 over a year ago.  I have an Arch Linux
user running into this bug who confirms the patch fixes their issues.

ChangeLog:

2014-10-xx  Bram  <bug_rh@spam.wizbit.be>

	[BZ #15378]
	* elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
	when none of the search directories exist.

 elf/dl-load.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/elf/dl-load.c b/elf/dl-load.c
index 9dd40e3..3ac64f3 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1897,9 +1897,9 @@ open_path (const char *name, size_t namelen, int mode,
       if (sps->malloced)
 	free (sps->dirs);
 
-      /* rtld_search_dirs is attribute_relro, therefore avoid writing
-	 into it.  */
-      if (sps != &rtld_search_dirs)
+      /* rtld_search_dirs and env_path_list are attribute_relro, therefore
+         avoid writing into it.  */
+      if (sps != &rtld_search_dirs && sps != &env_path_list)
 	sps->dirs = (void *) -1;
     }
 
-- 2.1.2