Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2014 17:14:09 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266411 - head/libexec/rtld-elf
Message-ID:  <201405181714.s4IHE9mT048966@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun May 18 17:14:08 2014
New Revision: 266411
URL: http://svnweb.freebsd.org/changeset/base/266411

Log:
  Fix LD_LIBMAP.
  The r232862 passed the pointer to end of string to lmc_parse() and free().
  
  Submitted by:	Wolfgang Jenkner <wjenkner@inode.at>
  MFC after:	1 week

Modified:
  head/libexec/rtld-elf/libmap.c

Modified: head/libexec/rtld-elf/libmap.c
==============================================================================
--- head/libexec/rtld-elf/libmap.c	Sun May 18 16:43:47 2014	(r266410)
+++ head/libexec/rtld-elf/libmap.c	Sun May 18 17:14:08 2014	(r266411)
@@ -80,7 +80,7 @@ lm_init(char *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);
@@ -94,8 +94,8 @@ lm_init(char *libmap_override)
 				break;
 			}
 		}
-		lmc_parse(p, strlen(p));
-		free(p);
+		lmc_parse(libmap_override, p - libmap_override);
+		free(libmap_override);
 	}
 
 	return (lm_count == 0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405181714.s4IHE9mT048966>