summaryrefslogtreecommitdiffstats
path: root/otautil/sysutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'otautil/sysutil.cpp')
-rw-r--r--otautil/sysutil.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/otautil/sysutil.cpp b/otautil/sysutil.cpp
index 2b4861809..420db4cac 100644
--- a/otautil/sysutil.cpp
+++ b/otautil/sysutil.cpp
@@ -94,6 +94,11 @@ BlockMapData BlockMapData::ParseBlockMapFile(const std::string& block_map_path)
remaining_blocks -= range_blocks;
}
+ if (remaining_blocks != 0) {
+ LOG(ERROR) << "Invalid ranges: remaining blocks " << remaining_blocks;
+ return {};
+ }
+
return BlockMapData(block_dev, file_size, blksize, std::move(ranges));
}