Merge "fs_mgr: fix SIGSEGV when ostream << nullptr" am: 225f0d98c8 am: 9af4b13b8f
am: 942b4efa2e
Change-Id: Ibcac8ee1c680401a9311da0429cc482fb46a7344
This commit is contained in:
commit
63d224a2bc
1 changed files with 12 additions and 8 deletions
|
|
@ -949,16 +949,20 @@ int fs_mgr_mount_all(struct fstab *fstab, int mount_mode)
|
||||||
}
|
}
|
||||||
encryptable = FS_MGR_MNTALL_DEV_MIGHT_BE_ENCRYPTED;
|
encryptable = FS_MGR_MNTALL_DEV_MIGHT_BE_ENCRYPTED;
|
||||||
} else {
|
} else {
|
||||||
|
// fs_options might be null so we cannot use PERROR << directly.
|
||||||
|
// Use StringPrintf to output "(null)" instead.
|
||||||
if (fs_mgr_is_nofail(&fstab->recs[attempted_idx])) {
|
if (fs_mgr_is_nofail(&fstab->recs[attempted_idx])) {
|
||||||
PERROR << "Ignoring failure to mount an un-encryptable or wiped partition on"
|
PERROR << android::base::StringPrintf(
|
||||||
<< fstab->recs[attempted_idx].blk_device << " at "
|
"Ignoring failure to mount an un-encryptable or wiped "
|
||||||
<< fstab->recs[attempted_idx].mount_point << " options: "
|
"partition on %s at %s options: %s",
|
||||||
<< fstab->recs[attempted_idx].fs_options;
|
fstab->recs[attempted_idx].blk_device, fstab->recs[attempted_idx].mount_point,
|
||||||
|
fstab->recs[attempted_idx].fs_options);
|
||||||
} else {
|
} else {
|
||||||
PERROR << "Failed to mount an un-encryptable or wiped partition on"
|
PERROR << android::base::StringPrintf(
|
||||||
<< fstab->recs[attempted_idx].blk_device << " at "
|
"Failed to mount an un-encryptable or wiped partition "
|
||||||
<< fstab->recs[attempted_idx].mount_point << " options: "
|
"on %s at %s options: %s",
|
||||||
<< fstab->recs[attempted_idx].fs_options;
|
fstab->recs[attempted_idx].blk_device, fstab->recs[attempted_idx].mount_point,
|
||||||
|
fstab->recs[attempted_idx].fs_options);
|
||||||
++error_count;
|
++error_count;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue