diff options
author | Brian Carlstrom <bdc@google.com> | 2014-05-26 05:44:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-26 05:44:55 +0000 |
commit | 8b5b1e5593ffa77c393e4172b71a3d5a821d2ed8 (patch) | |
tree | 96e32830904eae3e64e6ad2798732f7870653180 | |
parent | 30395fc865599619f22df7c99d7553b18304622c (diff) | |
parent | d6cec905b62dff38285b350e67d5e223346e6d66 (diff) | |
download | android_art-8b5b1e5593ffa77c393e4172b71a3d5a821d2ed8.tar.gz android_art-8b5b1e5593ffa77c393e4172b71a3d5a821d2ed8.tar.bz2 android_art-8b5b1e5593ffa77c393e4172b71a3d5a821d2ed8.zip |
Merge "Make DexFile content read only before running DexFileVerifier"
-rw-r--r-- | runtime/dex_file.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc index 9cb2f1ba01..3ff55ab323 100644 --- a/runtime/dex_file.cc +++ b/runtime/dex_file.cc @@ -258,15 +258,15 @@ const DexFile* DexFile::Open(const ZipArchive& zip_archive, const std::string& l error_msg->c_str()); return nullptr; } - if (!DexFileVerifier::Verify(dex_file.get(), dex_file->Begin(), dex_file->Size(), - location.c_str(), error_msg)) { - return nullptr; - } if (!dex_file->DisableWrite()) { *error_msg = StringPrintf("Failed to make dex file '%s' read only", location.c_str()); return nullptr; } CHECK(dex_file->IsReadOnly()) << location; + if (!DexFileVerifier::Verify(dex_file.get(), dex_file->Begin(), dex_file->Size(), + location.c_str(), error_msg)) { + return nullptr; + } return dex_file.release(); } |