From f812d8c7cf017c0ccba0eb2e5da9fd302fb27338 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 17 Feb 2017 10:19:44 -0800 Subject: [PATCH] ART: Fix oatdump dex export Check for start index. Bug: 35459241 Test: m Test: m test-art-host-gtest-oatdump_test Change-Id: I655d7be93427fd219ec445187c1d49076883bd3e --- oatdump/oatdump.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index 44132868a..a0919a197 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) { -- 2.11.0