fa3bfd
From 9317ea653afc26402387cac67042f9890af6add2 Mon Sep 17 00:00:00 2001
fa3bfd
From: Bram <bug_rh@spam.wizbit.be>
fa3bfd
Date: Thu, 18 Apr 2013 16:50:49 +0200
fa3bfd
Subject: [PATCH] Fix segmentation fault when LD_LIBRARY_PATH contains only
fa3bfd
 non-existings paths
fa3bfd
fa3bfd
---
fa3bfd
 ChangeLog     |  6 ++++++
fa3bfd
 NEWS          | 18 +++++++++---------
fa3bfd
 elf/dl-load.c |  6 +++---
fa3bfd
 3 files changed, 18 insertions(+), 12 deletions(-)
fa3bfd
fa3bfd
diff --git a/elf/dl-load.c b/elf/dl-load.c
fa3bfd
index 73174aa..41b91fc 100644
fa3bfd
--- a/elf/dl-load.c
fa3bfd
+++ b/elf/dl-load.c
fa3bfd
@@ -1889,9 +1889,9 @@ open_path (const char *name, size_t namelen, int mode,
fa3bfd
       if (sps->malloced)
fa3bfd
 	free (sps->dirs);
fa3bfd
 
fa3bfd
-      /* rtld_search_dirs is attribute_relro, therefore avoid writing
fa3bfd
-	 into it.  */
fa3bfd
-      if (sps != &rtld_search_dirs)
fa3bfd
+      /* rtld_search_dirs and env_path_list are attribute_relro, therefore
fa3bfd
+         avoid writing into it.  */
fa3bfd
+      if (sps != &rtld_search_dirs && sps != &env_path_list)
fa3bfd
 	sps->dirs = (void *) -1;
fa3bfd
     }
fa3bfd
 
fa3bfd
-- 
fa3bfd
1.8.3.1
fa3bfd