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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to