summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-07-22 12:44:41 +0100
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-07-22 12:44:41 +0100
commita73b2264dfd89d526054e4be9926be9f50cca791 (patch)
treee13d1ff1ef252570eccbace86458de4a74301856
parent806fc566fd4544cfcd3334aa1a992bab0f6d277c (diff)
downloadsystem_core-a73b2264dfd89d526054e4be9926be9f50cca791.zip
system_core-a73b2264dfd89d526054e4be9926be9f50cca791.tar.gz
system_core-a73b2264dfd89d526054e4be9926be9f50cca791.tar.bz2
fs_mgr: Don't assume all fstab entries have options
Change-Id: I5f537b09d96efa2758372f9da6d66996c2164ee8
-rw-r--r--fs_mgr/fs_mgr.c10
1 files 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