diff options
author | Alessandro Astone <ales.astone@gmail.com> | 2019-04-09 19:28:28 +0200 |
---|---|---|
committer | Alessandro Astone <ales.astone@gmail.com> | 2019-04-10 22:49:39 +0200 |
commit | a674419675e5f5b9c7359698f90dfc3d316cda44 (patch) | |
tree | 0228ae32c44a5ff4f8a3a1ab0caca0d409177d1b | |
parent | 8efd2e4c55ac6ccb7d712a2f8cdc751925492076 (diff) | |
download | android_bootable_recovery-a674419675e5f5b9c7359698f90dfc3d316cda44.tar.gz android_bootable_recovery-a674419675e5f5b9c7359698f90dfc3d316cda44.tar.bz2 android_bootable_recovery-a674419675e5f5b9c7359698f90dfc3d316cda44.zip |
recovery: always create emulated volume if we fail to detect fs
* the first fstab entry for data will be used.
* this also prevents strcmp to be called on a null parameter,
which ended up crashing some devices
Change-Id: I1df70d9df462ab30c857e834152b75d083d77652
-rw-r--r-- | volume_manager/VolumeManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/volume_manager/VolumeManager.cpp b/volume_manager/VolumeManager.cpp index 10a3cda4..3854abaa 100644 --- a/volume_manager/VolumeManager.cpp +++ b/volume_manager/VolumeManager.cpp @@ -125,7 +125,7 @@ static int process_config(VolumeManager* vm, fstab_rec** data_recp) { if (!*data_recp && !strcmp(fstab->recs[i].mount_point, "/data")) { char* detected_fs_type = blkid_get_tag_value(nullptr, "TYPE", fstab->recs[i].blk_device); - if (!strcmp(detected_fs_type, fstab->recs[i].fs_type)) { + if (!detected_fs_type || !strcmp(detected_fs_type, fstab->recs[i].fs_type)) { *data_recp = &fstab->recs[i]; } } |