From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 28 17:04:11 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 974F516A446 for ; Mon, 28 Nov 2005 17:04:11 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2737343D4C for ; Mon, 28 Nov 2005 17:04:07 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2741927 for multiple; Mon, 28 Nov 2005 12:04:17 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jASH3rCK058457; Mon, 28 Nov 2005 12:04:03 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Mon, 28 Nov 2005 11:32:11 -0500 User-Agent: KMail/1.8.2 References: <438505D6.7090202@mawer.org> In-Reply-To: <438505D6.7090202@mawer.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511281132.12192.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Antony Mawer Subject: Re: libutil properties_read() bug: patch for review X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2005 17:04:11 -0000 On Wednesday 23 November 2005 07:14 pm, Antony Mawer wrote: > Hi, > > I recently hit upon a bug in sysinstall, getting an "Invalid realloc > size of 0" error that caused sysinstall to terminate. I eventually > tracked it down to a bug in the properties_read() function of libutil, > which occurs only when reading a properties file of 4096 bytes or > greater. This is because libutil discards its current state when the > buffer runs out (4096 bytes) and it must refill the buffer, causing the > properties file (*.inf) to be incorrectly read. > > I've made a patch that's attached to the PR I filed, PR 89181, but was > hoping to get some extra eyes on the patch to make sure that there's > nothing amiss with the patch: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=89181 > > Hopefully someone can review this and see about getting it committed for > 6.1! I just committed it to HEAD. It should be MFC'd in time for both 5.5 and 6.1. Thanks! -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org