From owner-svn-src-head@FreeBSD.ORG Sun May 18 17:14:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4632E305; Sun, 18 May 2014 17:14:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33C172A73; Sun, 18 May 2014 17:14:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IHE92w048967; Sun, 18 May 2014 17:14:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IHE9mT048966; Sun, 18 May 2014 17:14:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201405181714.s4IHE9mT048966@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 18 May 2014 17:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266411 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 17:14:09 -0000 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 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);