summaryrefslogtreecommitdiffstats
path: root/fs_mgr
diff options
context:
space:
mode:
authorDavid Zeuthen <zeuthen@google.com>2017-05-01 12:43:34 -0400
committerDavid Zeuthen <zeuthen@google.com>2017-05-01 13:25:20 -0400
commit16c6fd1da7ecbafdd0d72c945d4974edc088d269 (patch)
treed328d730d1debee6e51b09356c3f6a8779ca29c7 /fs_mgr
parentae10af60506dd44de8456c8fe4554a3260fbbe34 (diff)
downloadcore-16c6fd1da7ecbafdd0d72c945d4974edc088d269.tar.gz
core-16c6fd1da7ecbafdd0d72c945d4974edc088d269.tar.bz2
core-16c6fd1da7ecbafdd0d72c945d4974edc088d269.zip
fs_mgr: Clear AvbOps struct.
This ensures that future operations (e.g. function pointers in the AvbOps struct) added to AvbOps are set to NULL. Bug: 37709309 Test: Manually tested on UEFI-based bootloader. Change-Id: If83ea57b7abad94e472768c594efa210e3351a4d
Diffstat (limited to 'fs_mgr')
-rw-r--r--fs_mgr/fs_mgr_avb_ops.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs_mgr/fs_mgr_avb_ops.cpp b/fs_mgr/fs_mgr_avb_ops.cpp
index edcfd544a..caee4ecb3 100644
--- a/fs_mgr/fs_mgr_avb_ops.cpp
+++ b/fs_mgr/fs_mgr_avb_ops.cpp
@@ -96,7 +96,9 @@ FsManagerAvbOps::FsManagerAvbOps(const std::string& device_file_by_name_prefix)
// We only need to provide the implementation of read_from_partition()
// operation since that's all what is being used by the avb_slot_verify().
// Other I/O operations are only required in bootloader but not in
- // user-space so we set them as dummy operations.
+ // user-space so we set them as dummy operations. Also zero the entire
+ // struct so operations added in the future will be set to NULL.
+ memset(&avb_ops_, 0, sizeof(AvbOps));
avb_ops_.read_from_partition = read_from_partition;
avb_ops_.read_rollback_index = dummy_read_rollback_index;
avb_ops_.validate_vbmeta_public_key = dummy_validate_vbmeta_public_key;