[LTP] [PATCH] lib: don't pass NULL to strcmp in safe_mount

Jan Stancek jstancek@redhat.com
Wed Nov 20 07:51:38 CET 2019



----- 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.



More information about the ltp mailing list