summaryrefslogtreecommitdiffstats
path: root/oatdump
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2017-02-17 10:19:44 -0800
committerAndreas Gampe <agampe@google.com>2017-02-17 10:19:44 -0800
commitf812d8c7cf017c0ccba0eb2e5da9fd302fb27338 (patch)
tree4991529e4bc4362985c2659f179abfbc9def848a /oatdump
parenta7e9bfafeb64b1142433a41b05ddc263cadc61e3 (diff)
downloadandroid_art-f812d8c7cf017c0ccba0eb2e5da9fd302fb27338.tar.gz
android_art-f812d8c7cf017c0ccba0eb2e5da9fd302fb27338.tar.bz2
android_art-f812d8c7cf017c0ccba0eb2e5da9fd302fb27338.zip
ART: Fix oatdump dex export
Check for start index. Bug: 35459241 Test: m Test: m test-art-host-gtest-oatdump_test Change-Id: I655d7be93427fd219ec445187c1d49076883bd3e
Diffstat (limited to 'oatdump')
-rw-r--r--oatdump/oatdump.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 44132868a1..a0919a1974 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -1018,7 +1018,9 @@ class OatDumper {
dex_orig_name = dex_file_location.substr(dex_orig_pos + 1);
// A more elegant approach to efficiently name user installed apps is welcome
- if (dex_orig_name.size() == 8 && !dex_orig_name.compare("base.apk")) {
+ if (dex_orig_name.size() == 8 &&
+ dex_orig_name.compare("base.apk") == 0 &&
+ dex_orig_pos != std::string::npos) {
dex_file_location.erase(dex_orig_pos, strlen("base.apk") + 1);
size_t apk_orig_pos = dex_file_location.rfind('/');
if (apk_orig_pos != std::string::npos) {