]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
More LD_PRELOAD parsing fixes.
authorUlrich Drepper <drepper@redhat.com>
Tue, 21 Jul 1998 12:16:28 +0000 (12:16 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 21 Jul 1998 12:16:28 +0000 (12:16 +0000)
elf/rtld.c

index dc63dd5a8c8586dc6c83a78f3262c01d8da72f1a..1474896de1e649414bbf2ceca715ac640eb81a68 100644 (file)
@@ -368,17 +368,15 @@ 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;
-      list += strspn (list, " :");
-      while (list && *list && (p = strsep (&list, " :")) != NULL)
-       if (! __libc_enable_secure || strchr (p, '/') == NULL)
+      while ((p = strsep (&list, " :")) != NULL)
+       if (p[0] != '\0'
+           && (! __libc_enable_secure || strchr (p, '/') == NULL))
          {
            struct link_map *new_map = _dl_map_object (l, p, 1, lt_library, 0);
            if (new_map->l_opencount == 1)
              /* It is no duplicate.  */
              ++npreloads;
          }
-      if (list != NULL)
-       list += strspn (list, " :");
 
       if (__libc_enable_secure)
        unsetenv ("LD_PRELOAD");