about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-10-18 15:37:14 +0000
committerUlrich Drepper <drepper@redhat.com>2004-10-18 15:37:14 +0000
commit71fa9dfb12df1bc741e105b96b0201cb5f728d63 (patch)
tree2142c494b24c1af81d7bffbea3abf959a3588ce1 /elf/dl-open.c
parent36106aabeb487f646c696486e0429f550d8fa0b8 (diff)
downloadglibc-71fa9dfb12df1bc741e105b96b0201cb5f728d63.tar.gz
glibc-71fa9dfb12df1bc741e105b96b0201cb5f728d63.tar.xz
glibc-71fa9dfb12df1bc741e105b96b0201cb5f728d63.zip
(dl_open_worker): Avoid dereferencing map in statically linked code if there might none be found.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 34e2aff15e..2ab1e307a4 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -207,7 +207,15 @@ dl_open_worker (void *a)
 
     found_caller:
       if (args->nsid == __LM_ID_CALLER)
-	args->nsid = call_map->l_ns;
+	{
+#ifndef SHARED
+	  /* In statically linked apps there might be no loaded object.  */
+	  if (call_map == NULL)
+	    args->nsid = LM_ID_BASE;
+	  else
+#endif
+	    args->nsid = call_map->l_ns;
+	}
     }
 
   /* Maybe we have to expand a DST.  */