From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 1 16:20:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D55D5395 for ; Fri, 1 Mar 2013 16:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id C84407FF for ; Fri, 1 Mar 2013 16:20:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r21GK2sL082535 for ; Fri, 1 Mar 2013 16:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r21GK2Od082534; Fri, 1 Mar 2013 16:20:02 GMT (envelope-from gnats) Date: Fri, 1 Mar 2013 16:20:02 GMT Message-Id: <201303011620.r21GK2Od082534@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: kern/175648: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2013 16:20:02 -0000 The following reply was made to PR kern/175648; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/175648: commit references a PR Date: Fri, 1 Mar 2013 16:18:59 +0000 (UTC) Author: jhb Date: Fri Mar 1 16:18:40 2013 New Revision: 247553 URL: http://svnweb.freebsd.org/changeset/base/247553 Log: MFC 246035: - Compute the correct size to reallocate when doubling the size of the array of loaded objects to avoid a buffer overrun. - Use reallocf() to avoid leaking memory if the realloc() fails. PR: kern/175648 Modified: stable/9/lib/libproc/proc_rtld.c Directory Properties: stable/9/lib/libproc/ (props changed) Modified: stable/9/lib/libproc/proc_rtld.c ============================================================================== --- stable/9/lib/libproc/proc_rtld.c Fri Mar 1 15:59:14 2013 (r247552) +++ stable/9/lib/libproc/proc_rtld.c Fri Mar 1 16:18:40 2013 (r247553) @@ -44,7 +44,8 @@ map_iter(const rd_loadobj_t *lop, void * if (phdl->nobjs >= phdl->rdobjsz) { phdl->rdobjsz *= 2; - phdl->rdobjs = realloc(phdl->rdobjs, phdl->rdobjsz); + phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) * + phdl->rdobjsz); if (phdl->rdobjs == NULL) return (-1); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"