summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-01-30 01:07:52 +0100
committerandroid-build-merger <android-build-merger@google.com>2019-01-30 01:07:52 +0100
commit89b92c1217cb3587359f6c1f085c6eddecc6d336 (patch)
tree57e9e14b6e0510a9edf1fe471a4f767e61260102
parent[automerger skipped] Merge "DO NOT MERGE: Revert "Revert "Add libprocessgroup dependency""" am: 5342de92e0 -s ours am: 2b8e48240e -s ours (diff)
parentMerge "Fix potential size overflow in blockimg.cpp" am: 9a54dd3bf9 (diff)
downloadandroid_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.tar
android_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.tar.gz
android_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.tar.bz2
android_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.tar.lz
android_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.tar.xz
android_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.tar.zst
android_bootable_recovery-89b92c1217cb3587359f6c1f085c6eddecc6d336.zip
Diffstat (limited to '')
-rw-r--r--updater/blockimg.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index 6e5d5bb55..07c3c7b52 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -1525,7 +1525,7 @@ static int PerformCommandComputeHashTree(CommandParameters& params) {
// Starts the hash_tree computation.
HashTreeBuilder builder(BLOCKSIZE, hash_function);
- if (!builder.Initialize(source_ranges.blocks() * BLOCKSIZE, salt)) {
+ if (!builder.Initialize(static_cast<int64_t>(source_ranges.blocks()) * BLOCKSIZE, salt)) {
LOG(ERROR) << "Failed to initialize hash tree computation, source " << source_ranges.ToString()
<< ", salt " << salt_hex;
return -1;
@@ -1915,8 +1915,10 @@ pbiudone:
const char* partition = strrchr(blockdev_filename->data.c_str(), '/');
if (partition != nullptr && *(partition + 1) != 0) {
- fprintf(cmd_pipe, "log bytes_written_%s: %zu\n", partition + 1, params.written * BLOCKSIZE);
- fprintf(cmd_pipe, "log bytes_stashed_%s: %zu\n", partition + 1, params.stashed * BLOCKSIZE);
+ fprintf(cmd_pipe, "log bytes_written_%s: %" PRIu64 "\n", partition + 1,
+ static_cast<uint64_t>(params.written) * BLOCKSIZE);
+ fprintf(cmd_pipe, "log bytes_stashed_%s: %" PRIu64 "\n", partition + 1,
+ static_cast<uint64_t>(params.stashed) * BLOCKSIZE);
fflush(cmd_pipe);
}
// Delete stash only after successfully completing the update, as it may contain blocks needed