[LTP] [PATCH] lib: don't pass NULL to strcmp in safe_mount
Li Wang
liwang@redhat.com
Wed Nov 20 08:53:53 CET 2019
On Wed, Nov 20, 2019 at 2:51 PM Jan Stancek <jstancek@redhat.com> wrote:
>
>
> ----- Original Message -----
> > On Tue, Nov 19, 2019 at 6:29 PM Jan Stancek <jstancek@redhat.com> wrote:
> >
> > > Rachel reports, that pivot_root01 crashes on latest LTP:
> > > Thread 3.1 "pivot_root01" received signal SIGSEGV, Segmentation
> fault.
> > > 0x00000000004062c4 in safe_mount (file=file@entry=0x413017
> > > "pivot_root01.c"
> > > 733 if (strcmp(filesystemtype, "ntfs")) {
> > >
> > > Don't pass NULL ptr to strcmp. Also fix return in unreachable path,
> > > to suppress warning about returning uninitialized 'rval'.
> > >
> >
> > Good catch.
> >
> > And shouldn't we give a "correct" fs_type in pivot_root01.c too?
> Otherwise,
> > the test would be failed on an invalid mounted operation I guess.
>
> Per man-page, it should be ignored.
>
Ok, then this patch looks good.
Reviewed-by: Li Wang <liwang@redhat.com>
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191120/e579d101/attachment.htm>
More information about the ltp
mailing list