diff options
author | Tao Bao <tbao@google.com> | 2016-01-14 01:41:04 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-01-14 01:41:04 +0100 |
commit | 0305fcecc5b1a9f8172ca1753a29b6963e7bb474 (patch) | |
tree | 2c1a37e28ed4646e967ce84642e33e2dbf5a9a03 /uncrypt/uncrypt.cpp | |
parent | Merge "Rename .l/.y to .ll/.yy" (diff) | |
parent | uncrypt: avoid use-after-free (diff) | |
download | android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.tar android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.tar.gz android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.tar.bz2 android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.tar.lz android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.tar.xz android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.tar.zst android_bootable_recovery-0305fcecc5b1a9f8172ca1753a29b6963e7bb474.zip |
Diffstat (limited to 'uncrypt/uncrypt.cpp')
-rw-r--r-- | uncrypt/uncrypt.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp index 20efbe4df..de7e48182 100644 --- a/uncrypt/uncrypt.cpp +++ b/uncrypt/uncrypt.cpp @@ -418,8 +418,6 @@ int uncrypt(const char* input_path, const char* map_file, int status_fd) { } int main(int argc, char** argv) { - const char* input_path; - const char* map_file; if (argc != 3 && argc != 1 && (argc == 2 && strcmp(argv[1], "--reboot") != 0)) { fprintf(stderr, "usage: %s [--reboot] [<transform_path> <map_file>]\n", argv[0]); @@ -443,13 +441,16 @@ int main(int argc, char** argv) { } unique_fd status_fd_holder(status_fd); + std::string package; + const char* input_path; + const char* map_file; + if (argc == 3) { // when command-line args are given this binary is being used // for debugging. input_path = argv[1]; map_file = argv[2]; } else { - std::string package; if (!find_uncrypt_package(package)) { android::base::WriteStringToFd("-1\n", status_fd); return 1; |