about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-07-07 12:00:24 +0000
committerUlrich Drepper <drepper@redhat.com>1998-07-07 12:00:24 +0000
commit6d2e37472f31f23c75470fb0402edd019edbc8f6 (patch)
treeaf9462950c670199478f4f5730710ff1096f1cc9 /elf
parentfa2eb9311eff68defc390fa494376f91d3bc3f17 (diff)
downloadglibc-6d2e37472f31f23c75470fb0402edd019edbc8f6.tar.gz
glibc-6d2e37472f31f23c75470fb0402edd019edbc8f6.tar.xz
glibc-6d2e37472f31f23c75470fb0402edd019edbc8f6.zip
Fix problem with empty LD_PRELOAD value.
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 9f6f1136f3..e26e4574ad 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -364,7 +364,8 @@ of this helper program; chances are you did not intend to run this program.\n",
 	 containing a '/' are ignored since it is insecure.  */
       char *list = strdupa (preloadlist);
       char *p;
-      while ((p = strsep (&list, " :")) != NULL)
+      list += strspn (list, " :");
+      while (*list && (p = strsep (&list, " :")) != NULL)
 	if (! __libc_enable_secure || strchr (p, '/') == NULL)
 	  {
 	    struct link_map *new_map = _dl_map_object (l, p, 1, lt_library, 0);
@@ -372,6 +373,8 @@ of this helper program; chances are you did not intend to run this program.\n",
 	      /* It is no duplicate.  */
 	      ++npreloads;
 	  }
+      if (list != NULL)
+	list += strspn (list, " :");
     }
 
   /* Read the contents of the file.  */
@@ -427,7 +430,7 @@ of this helper program; chances are you did not intend to run this program.\n",
 	{
 	  char *p;
 	  runp = file + strspn (file, ": \t\n");
-	  while ((p = strsep (&runp, ": \t\n")) != NULL)
+	  while (*runp && (p = strsep (&runp, ": \t\n")) != NULL)
 	    {
 	      struct link_map *new_map = _dl_map_object (l, p, 1,
 							 lt_library, 0);