Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c376943 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add missing size check when parsing staged aliases" into sc-qpr1-dev am: 81e1e9b5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16371979

Change-Id: I04bc0f2026f7780fc27bd3e4c9250edea898673f
parents 9399b998 81e1e9b5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -686,6 +686,12 @@ std::unique_ptr<const LoadedPackage> LoadedPackage::Load(const Chunk& chunk,
        std::unordered_set<uint32_t> finalized_ids;
        const auto lib_alias = child_chunk.header<ResTable_staged_alias_header>();
        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 {};
        }
        const auto entry_begin = child_chunk.data_ptr().convert<ResTable_staged_alias_entry>();