summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-11-29 20:54:04 +0100
committerTao Bao <tbao@google.com>2016-12-01 09:00:25 +0100
commitd0de070a390d4825cbbb6eeed5433720045f26eb (patch)
tree17f62871a8145488c6516f106df49791a5e7420a
parentMerge "Switch update verifier to HIDL HAL" am: 1528def46e am: ae2463bb35 am: 95beb966e2 (diff)
downloadandroid_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.tar
android_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.tar.gz
android_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.tar.bz2
android_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.tar.lz
android_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.tar.xz
android_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.tar.zst
android_bootable_recovery-d0de070a390d4825cbbb6eeed5433720045f26eb.zip
-rw-r--r--updater/updater.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/updater/updater.cpp b/updater/updater.cpp
index 46de9ad09..7327c52e3 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -105,7 +105,8 @@ int main(int argc, char** argv) {
return 4;
}
- std::string script(script_entry.uncompressed_length, '\0');
+ std::string script;
+ script.resize(script_entry.uncompressed_length);
int extract_err = ExtractToMemory(za, &script_entry, reinterpret_cast<uint8_t*>(&script[0]),
script_entry.uncompressed_length);
if (extract_err != 0) {
@@ -209,5 +210,6 @@ int main(int argc, char** argv) {
CloseArchive(updater_info.package_zip);
}
sysReleaseMap(&map);
+
return 0;
}