rtld: Fix LD_LIBMAP under libmap override
authorJohn Marino <draco@marino.st>
Sun, 30 Nov 2014 09:59:20 +0000 (10:59 +0100)
committerJohn Marino <draco@marino.st>
Sun, 30 Nov 2014 16:50:49 +0000 (17:50 +0100)
Taken from: FreeBSD svn 266411 (18 May 2014)

libexec/rtld-elf/libmap.c

index 8124a29..80d9a91 100644 (file)
@@ -75,7 +75,7 @@ lm_init(char *libmap_override)
 
        if (libmap_override) {
                /*
 
        if (libmap_override) {
                /*
-                * Do some character replacement to make $LIBMAP look
+                * Do some character replacement to make $LDLIBMAP look
                 * like a text file, then parse it.
                 */
                libmap_override = xstrdup(libmap_override);
                 * like a text file, then parse it.
                 */
                libmap_override = xstrdup(libmap_override);
@@ -89,8 +89,8 @@ lm_init(char *libmap_override)
                                break;
                        }
                }
                                break;
                        }
                }
-               lmc_parse(p, strlen(p));
-               free(p);
+               lmc_parse(libmap_override, p - libmap_override);
+               free(libmap_override);
        }
 
        return (lm_count == 0);
        }
 
        return (lm_count == 0);