bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mount crashes


From: Marcus Brinkmann
Subject: Re: Mount crashes
Date: Mon, 12 Feb 2001 21:38:48 +0100
User-agent: Mutt/1.1.4i

Hi Alexy,

sorry for getting back to you so late.

Can you explain in one or two sentences, under which conditions which
of the mntent fields are zero when this function is called? The C library
will always return the empty string instead of NULL, so I wonder if the
patch is correct, or if the bug is probably in the caller.

The macro is not entirely safe. To make it safer, it should be enclosed in
a block. Also, the semicolon can go then. But don't worry about that, I will
do it when this is the right place to fix it.

Thanks,
Marcus

On Wed, Dec 13, 2000 at 10:44:39PM +0300, Alexey Dejneka wrote:
> $ mount -t isofs /dev/hd2 /cdrom
> gives segmentation fault.
> Patch:
> ---cut here---
> diff -ur hurd/sutils/fstab.c hurd-new/sutils/fstab.c
> --- hurd/sutils/fstab.c       Fri Nov 19 08:06:18 1999
> +++ hurd-new/sutils/fstab.c   Wed Dec 13 11:06:03 2000
> @@ -275,7 +275,12 @@
>    /* Copy each mntent field from MNTENT into FS's version.  */
>    end = fs->storage;
>  #define STORE(field) \
> -    fs->mntent.field = end; end = stpcpy (end, mntent->field) + 1
> +    if (mntent->field) \
> +      { \
> +     fs->mntent.field = end; end = stpcpy (end, mntent->field) + 1; \
> +      } else { \
> +        fs->mntent.field = 0; *end++ = 0;\
> +      }
>    STORE (mnt_fsname);
>    STORE (mnt_dir);
>    STORE (mnt_type);
> ---cut here---
> 
> _______________________________________________
> Bug-hurd mailing list
> Bug-hurd@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-hurd
> 

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]