From a73b2264dfd89d526054e4be9926be9f50cca791 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 22 Jul 2013 12:44:41 +0100 Subject: fs_mgr: Don't assume all fstab entries have options Change-Id: I5f537b09d96efa2758372f9da6d66996c2164ee8 --- fs_mgr/fs_mgr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c index 848743c..23682cb 100644 --- a/fs_mgr/fs_mgr.c +++ b/fs_mgr/fs_mgr.c @@ -457,11 +457,13 @@ int fs_mgr_mount_all(char *fstab_file) for (i = 0; fstab[i].blk_dev; i++) { #ifndef HAVE_SELINUX - char *contextpos = strstr(fstab[i].fs_options,",context="); + if (fstab[i].fs_options) { + char *contextpos = strstr(fstab[i].fs_options,",context="); - /* This makes it mandatory that context is the LAST mount option */ - if (contextpos != NULL) { - *contextpos='\0'; + /* This makes it mandatory that context is the LAST mount option */ + if (contextpos != NULL) { + *contextpos='\0'; + } } #endif -- cgit v1.1