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