Date: Fri, 30 Nov 2001 02:13:35 +0100 From: Maxime Henrion <mux@qualys.com> To: current@FreeBSD.org Cc: Mikko Tyolajarvi <mikko@dynas.se> Subject: Re: df -l broken Message-ID: <20011130021335.A284@nebula.noos.fr> In-Reply-To: <200111300046.fAU0kT653075@mikko.rsa.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011130021335.A284>
