summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/dex_file_verifier.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/runtime/dex_file_verifier.cc b/runtime/dex_file_verifier.cc
index a1c8c7169..17d1ffc12 100644
--- a/runtime/dex_file_verifier.cc
+++ b/runtime/dex_file_verifier.cc
@@ -698,6 +698,7 @@ bool DexFileVerifier::CheckIntraStringDataItem() {
const byte* file_end = begin_ + size_;
for (uint32_t i = 0; i < size; i++) {
+ CHECK_LT(i, size); // b/15014252 Prevents hitting the impossible case below
if (UNLIKELY(ptr_ >= file_end)) {
ErrorStringPrintf("String data would go beyond end-of-file");
return false;
@@ -710,6 +711,7 @@ bool DexFileVerifier::CheckIntraStringDataItem() {
case 0x00:
// Special case of bit pattern 0xxx.
if (UNLIKELY(byte == 0)) {
+ CHECK_LT(i, size); // b/15014252 Actually hit this impossible case with clang
ErrorStringPrintf("String data shorter than indicated utf16_size %x", size);
return false;
}