summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-12-01 17:52:12 +0100
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-12-01 17:52:12 +0100
commita7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee (patch)
treeb615e12a5a9fea069b7c47f245da8ae4f0e06195
parentMerge "bootable/recovery: cleanup compiler warnings (potential leak of memory)" am: d255b661a1 am: be54feda58 am: 83b649ee1d (diff)
parentupdater: Fix inconsistent code. (diff)
downloadandroid_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.tar
android_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.tar.gz
android_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.tar.bz2
android_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.tar.lz
android_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.tar.xz
android_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.tar.zst
android_bootable_recovery-a7feeb4dce1a1ab6fe1cca783c967dd80c2a7aee.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;
}