Add range CHECK for method index in GetQuickenedInfoOf
Make sure the method index is in the range of the dex file. Aims to
debug possible corruption.
Bug: 76162418
Test: test-art-host
Change-Id: Iba0a4d32e6a8c486cc67fdc1e2fbcb5531ea897f
diff --git a/runtime/vdex_file.cc b/runtime/vdex_file.cc
index ec4dc41..838d7f1 100644
--- a/runtime/vdex_file.cc
+++ b/runtime/vdex_file.cc
@@ -317,6 +317,7 @@
if (quickening_info.empty()) {
return ArrayRef<const uint8_t>();
}
+ CHECK_LT(dex_method_idx, dex_file.NumMethodIds());
const uint32_t quickening_offset =
GetQuickenInfoOffsetTable(dex_file, quickening_info).GetOffset(dex_method_idx);
if (quickening_offset == 0u) {