summaryrefslogtreecommitdiffstats
path: root/updater/target_files.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-06-21 03:16:49 +0200
committerTianjie Xu <xunchang@google.com>2019-06-28 01:17:05 +0200
commitc3a161e2b8232a887efe73abe51ea9071052555d (patch)
tree32bef113f4d78ecb8f91f6c063c358497b887889 /updater/target_files.cpp
parentMerge "Implement updater runtime for dynamic partitions" (diff)
downloadandroid_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.tar
android_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.tar.gz
android_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.tar.bz2
android_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.tar.lz
android_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.tar.xz
android_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.tar.zst
android_bootable_recovery-c3a161e2b8232a887efe73abe51ea9071052555d.zip
Diffstat (limited to '')
-rw-r--r--updater/target_files.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/updater/target_files.cpp b/updater/target_files.cpp
index 93540b2e5..092edb9a8 100644
--- a/updater/target_files.cpp
+++ b/updater/target_files.cpp
@@ -132,6 +132,11 @@ bool TargetFile::ReadEntryToString(const std::string_view name, std::string* con
return false;
}
+ if (entry.uncompressed_length == 0) {
+ content->clear();
+ return true;
+ }
+
content->resize(entry.uncompressed_length);
if (auto extract_err = ExtractToMemory(
handle_, &entry, reinterpret_cast<uint8_t*>(&content->at(0)), entry.uncompressed_length);