[automerger] Fix DynamicRefTable::load security bug am: 8cf0f988b0
Change-Id: I17682a41fbacafd30a032bd78b176a883bc7bdd8
This commit is contained in:
@@ -6220,8 +6220,16 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (ctype == RES_TABLE_LIBRARY_TYPE) {
|
} else if (ctype == RES_TABLE_LIBRARY_TYPE) {
|
||||||
|
|
||||||
if (group->dynamicRefTable.entries().size() == 0) {
|
if (group->dynamicRefTable.entries().size() == 0) {
|
||||||
status_t err = group->dynamicRefTable.load((const ResTable_lib_header*) chunk);
|
const ResTable_lib_header* lib = (const ResTable_lib_header*) chunk;
|
||||||
|
status_t err = validate_chunk(&lib->header, sizeof(*lib),
|
||||||
|
endPos, "ResTable_lib_header");
|
||||||
|
if (err != NO_ERROR) {
|
||||||
|
return (mError=err);
|
||||||
|
}
|
||||||
|
|
||||||
|
err = group->dynamicRefTable.load(lib);
|
||||||
if (err != NO_ERROR) {
|
if (err != NO_ERROR) {
|
||||||
return (mError=err);
|
return (mError=err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user