summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-06-13 15:31:40 -0700
committerAndreas Gampe <agampe@google.com>2014-06-13 15:37:56 -0700
commitbb836e14541d5424328182f3e20ce08c691d041e (patch)
treecce21515e07f1a435bf2adb61facbaf6f8360ea3 /runtime
parent08eeb38bb95dbb41dbdb0ea023749889b126af61 (diff)
downloadart-bb836e14541d5424328182f3e20ce08c691d041e.tar.gz
art-bb836e14541d5424328182f3e20ce08c691d041e.tar.bz2
art-bb836e14541d5424328182f3e20ce08c691d041e.zip
ART: Dex file verifier can't blindly use GetDescriptor
The dex file verifier cannot call GetDescriptor without checking the index first. Bug: 15615908 Change-Id: Iec5e20b77aac3e6c25fb94b1b630d0846c0b8f33
Diffstat (limited to 'runtime')
-rw-r--r--runtime/dex_file_verifier.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/dex_file_verifier.cc b/runtime/dex_file_verifier.cc
index 3000217697..291e2d0756 100644
--- a/runtime/dex_file_verifier.cc
+++ b/runtime/dex_file_verifier.cc
@@ -1493,6 +1493,10 @@ bool DexFileVerifier::CheckInterProtoIdItem() {
DexFileParameterIterator it(*dex_file_, *item);
while (it.HasNext() && *shorty != '\0') {
+ if (!CheckIndex(it.GetTypeIdx(), dex_file_->NumTypeIds(),
+ "inter_proto_id_item shorty type_idx")) {
+ return false;
+ }
const char* descriptor = it.GetDescriptor();
if (!CheckShortyDescriptorMatch(*shorty, descriptor, false)) {
return false;