Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5

when passing damaged user-supplied fstab file data.

MFC after:	1 week
This commit is contained in:
Sergey Kandaurov 2012-03-22 09:42:27 +00:00
parent 5b0da85a41
commit 130b343048

View File

@ -91,7 +91,7 @@ fixfsfile()
struct stat sb;
struct statfs sf;
if (strcmp(_fs_fstab.fs_file, "/") != 0)
if (_fs_fstab.fs_file != NULL &&strcmp(_fs_fstab.fs_file, "/") != 0)
return;
if (statfs("/", &sf) != 0)
return;