From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 24 00:14:16 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 5938F16A41F for ; Thu, 24 Nov 2005 00:14:16 +0000 (GMT) (envelope-from fbsd-hackers@mawer.org) Received: from mail28.syd.optusnet.com.au (mail28.syd.optusnet.com.au [211.29.133.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id B390A43D46 for ; Thu, 24 Nov 2005 00:14:15 +0000 (GMT) (envelope-from fbsd-hackers@mawer.org) Received: from [127.0.0.1] (c220-237-120-88.thorn1.nsw.optusnet.com.au [220.237.120.88]) by mail28.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id jAO0ECZP006720 for ; Thu, 24 Nov 2005 11:14:13 +1100 Message-ID: <438505D6.7090202@mawer.org> Date: Thu, 24 Nov 2005 11:14:14 +1100 From: Antony Mawer User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: 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: Thu, 24 Nov 2005 00:14:16 -0000 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! -Antony