From: David Srbecky Date: Tue, 7 Jul 2015 18:13:29 +0000 (+0100) Subject: Accept 0xFFFFFFFF as dex debug info offset. X-Git-Tag: android-x86-7.1-r1~889^2~809^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6852942773fde6ac40cec204f5ad63daacd3c74d;p=android-x86%2Fart.git Accept 0xFFFFFFFF as dex debug info offset. Bug: 22023362 Change-Id: I03e5c74f5ece4dbe1fab37d8b5f857582b04f57c --- diff --git a/runtime/dex_file.h b/runtime/dex_file.h index 7ac264a0c..3a15f1ac7 100644 --- a/runtime/dex_file.h +++ b/runtime/dex_file.h @@ -786,7 +786,10 @@ class DexFile { // Get the pointer to the start of the debugging data const uint8_t* GetDebugInfoStream(const CodeItem* code_item) const { - if (code_item->debug_info_off_ == 0) { + // Check that the offset is in bounds. + // Note that although the specification says that 0 should be used if there + // is no debug information, some applications incorrectly use 0xFFFFFFFF. + if (code_item->debug_info_off_ == 0 || code_item->debug_info_off_ >= size_) { return nullptr; } else { return begin_ + code_item->debug_info_off_;