From owner-freebsd-current Thu Nov 29 17:13:40 2001 Delivered-To: freebsd-current@freebsd.org Received: from noos.fr (r178m112.cybercable.tm.fr [195.132.178.112]) by hub.freebsd.org (Postfix) with ESMTP id 5296437B416 for ; Thu, 29 Nov 2001 17:13:37 -0800 (PST) Received: (from mux@localhost) by noos.fr (8.11.6/8.11.4) id fAU1DZL05021; Fri, 30 Nov 2001 02:13:35 +0100 (CET) (envelope-from mux) Date: Fri, 30 Nov 2001 02:13:35 +0100 From: Maxime Henrion To: current@FreeBSD.org Cc: Mikko Tyolajarvi Subject: Re: df -l broken Message-ID: <20011130021335.A284@nebula.noos.fr> References: <200111252141.fAPLf1639599@trantor.xs4all.nl> <200111252256.fAPMubV20382@bunrab.catwhisker.org> <20011126000722.B280@nebula.noos.fr> <20011126222855.A14973@rtfm.net> <200111300046.fAU0kT653075@mikko.rsa.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200111300046.fAU0kT653075@mikko.rsa.com> User-Agent: Mutt/1.3.23i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mikko Tyolajarvi wrote: > In local.freebsd.current you write: > > >On Mon, Nov 26, 2001 at 12:07:22AM +0100, Maxime Henrion wrote: > >> If my patch is exact, then the bug should manifest itself only if there > >> are no network filesystems mounted. Do you have any network fs mounted > >> on your box ? > > >No networked filesystems here, and no problems: > > They don't have to be mounted, just loaded. E.g. if "nfs" > shows up with "lsvfs", "df -l " will work, if not, it won't. > (dunno about other network file systems). [...] I looked at the code a bit more closely and you're entirely right. I think I figured out why my patch caused a core dump. Here is a more correct patch that should fix the problem without causing core dumps. --- df.c 1 Aug 2001 02:09:09 -0000 1.32 +++ df.c 30 Nov 2001 01:06:52 -0000 @@ -561,7 +561,9 @@ *strptr = ','; free(listptr[i]); } - *(--strptr) = NULL; + if (i > 0) + strptr--; + *strptr = NULL; free(listptr); return (str); I would be happy to get some feedback, especially from the person who got a core dump. :-) Thanks, Maxime Henrion -- Don't be fooled by cheap finnish imitations ; BSD is the One True Code To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message