about summary refs log tree commit diff
path: root/elf/dl-error.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-07-07 06:02:07 +0000
committerUlrich Drepper <drepper@redhat.com>2005-07-07 06:02:07 +0000
commit587d6ddc60bbdf561be3f217280220af9102c3e8 (patch)
tree77b2e9018537209ca779c41b088f71fc202ff8de /elf/dl-error.c
parent9f0d7b6df903729a56bc464ff3721e80906933da (diff)
downloadglibc-587d6ddc60bbdf561be3f217280220af9102c3e8.tar.gz
glibc-587d6ddc60bbdf561be3f217280220af9102c3e8.tar.xz
glibc-587d6ddc60bbdf561be3f217280220af9102c3e8.zip
* elf/dl-error.c (_dl_signal_error): When testing for executable
	being relocated, take into account that nothing might even be loaded.
Diffstat (limited to 'elf/dl-error.c')
-rw-r--r--elf/dl-error.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/elf/dl-error.c b/elf/dl-error.c
index a63d801411..3a0d9bb8a7 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -98,8 +98,9 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
 	  /* If the main executable is relocated it means the libc's malloc
 	     is used.  */
 #ifdef SHARED
-	  lcatch->malloced = (GL(dl_ns)[LM_ID_BASE]._ns_loaded->l_relocated
-			      != 0);
+	  lcatch->malloced = (GL(dl_ns)[LM_ID_BASE]._ns_loaded != NULL
+			      && (GL(dl_ns)[LM_ID_BASE]._ns_loaded->l_relocated
+				  != 0));
 #else
 	  lcatch->malloced = true;
 #endif