diff options
author | Maxim Siniavine <siniavine@google.com> | 2014-02-14 00:03:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-02-14 00:03:28 +0000 |
commit | 48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb (patch) | |
tree | 24f52ed69b2b8ac11dd94a4699109aa02fea21f5 | |
parent | 3eb681d1de4eb0a4807e851c323568ed3f360381 (diff) | |
parent | e7b288824589b2828d83e1d47f6f12b0bd0fb353 (diff) | |
download | bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.zip bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.gz bootable_recovery-48f4c3d60c9679d2cb6cd2931c2bc1138f3777cb.tar.bz2 |
Merge "Fix a crash when going into recovery mode."
-rw-r--r-- | uncrypt/uncrypt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/uncrypt/uncrypt.c b/uncrypt/uncrypt.c index 1f0f59d..7c2d994 100644 --- a/uncrypt/uncrypt.c +++ b/uncrypt/uncrypt.c @@ -149,9 +149,14 @@ char* parse_recovery_command_file() int count = 0; char temp[1024]; - FILE* fo = fopen(RECOVERY_COMMAND_FILE_TMP, "w"); + FILE* f = fopen(RECOVERY_COMMAND_FILE, "r"); + if (f == NULL) { + return NULL; + } + FILE* fo = fopen(RECOVERY_COMMAND_FILE_TMP, "w"); + while (fgets(temp, sizeof(temp), f)) { printf("read: %s", temp); if (strncmp(temp, "--update_package=", strlen("--update_package=")) == 0) { |