From 130b34304899bff285a8c9c0c6a9c5a7910ce571 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Thu, 22 Mar 2012 09:42:27 +0000 Subject: [PATCH] Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5 when passing damaged user-supplied fstab file data. MFC after: 1 week --- lib/libc/gen/fstab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index 9dac476c4c67..e9c313d18aeb 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -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;