From: Ulrich Drepper Date: Tue, 21 Jul 1998 12:16:28 +0000 (+0000) Subject: More LD_PRELOAD parsing fixes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd0a9c8608fb20d262e7ae647c994dcb7e0c408e;p=thirdparty%2Fglibc.git More LD_PRELOAD parsing fixes. --- diff --git a/elf/rtld.c b/elf/rtld.c index dc63dd5a8c8..1474896de1e 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -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");