Skip to content

Commit

Permalink
Check corruption when reading uncrypt_status file
Browse files Browse the repository at this point in the history
Bug: 31383361
Change-Id: I0de920916da213528d73b742e4823b4a98c63ea1
(cherry picked from commit 1c1864f)
  • Loading branch information
Tianjie Xu committed Sep 13, 2016
1 parent e16e799 commit 41a3fd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ install_package(const char* path, bool* wipe_cache, const char* install_file,
std::string uncrypt_status;
if (!android::base::ReadFileToString(UNCRYPT_STATUS, &uncrypt_status)) {
PLOG(WARNING) << "failed to read uncrypt status";
} else if (!android::base::StartsWith(uncrypt_status, "uncrypt_time:")) {
PLOG(WARNING) << "corrupted uncrypt_status: " << uncrypt_status;
} else {
fprintf(install_log, "%s\n", android::base::Trim(uncrypt_status).c_str());
}
Expand Down

0 comments on commit 41a3fd4

Please sign in to comment.