Merge "Add missing size check when parsing staged aliases" into sc-v2-dev am: 067e59bbf6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16371987 Change-Id: I3b6895218f9b6b0d2a83a4bf94881cd1fb588758
This commit is contained in:
@@ -695,6 +695,12 @@ std::unique_ptr<const LoadedPackage> LoadedPackage::Load(const Chunk& chunk,
|
|||||||
std::unordered_set<uint32_t> finalized_ids;
|
std::unordered_set<uint32_t> finalized_ids;
|
||||||
const auto lib_alias = child_chunk.header<ResTable_staged_alias_header>();
|
const auto lib_alias = child_chunk.header<ResTable_staged_alias_header>();
|
||||||
if (!lib_alias) {
|
if (!lib_alias) {
|
||||||
|
LOG(ERROR) << "RES_TABLE_STAGED_ALIAS_TYPE is too small.";
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
if ((child_chunk.data_size() / sizeof(ResTable_staged_alias_entry))
|
||||||
|
< dtohl(lib_alias->count)) {
|
||||||
|
LOG(ERROR) << "RES_TABLE_STAGED_ALIAS_TYPE is too small to hold entries.";
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const auto entry_begin = child_chunk.data_ptr().convert<ResTable_staged_alias_entry>();
|
const auto entry_begin = child_chunk.data_ptr().convert<ResTable_staged_alias_entry>();
|
||||||
|
|||||||
Reference in New Issue
Block a user