summaryrefslogtreecommitdiffstats
path: root/applypatch/imgpatch.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-05-24 07:23:31 +0200
committerTianjie Xu <xunchang@google.com>2018-05-24 19:49:54 +0200
commitcc61cf6a9f74400956886c7f91efef581f4184e2 (patch)
tree3647f091fdaf8f61f3b97de44fdecee6aff1f782 /applypatch/imgpatch.cpp
parentMerge "recovery: Refactor common setup into main()" (diff)
downloadandroid_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.gz
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.bz2
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.lz
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.xz
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.tar.zst
android_bootable_recovery-cc61cf6a9f74400956886c7f91efef581f4184e2.zip
Diffstat (limited to '')
-rw-r--r--applypatch/imgpatch.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/applypatch/imgpatch.cpp b/applypatch/imgpatch.cpp
index c4c2707fb..2f8f4851d 100644
--- a/applypatch/imgpatch.cpp
+++ b/applypatch/imgpatch.cpp
@@ -54,6 +54,7 @@ static bool ApplyBSDiffPatchAndStreamOutput(const uint8_t* src_data, size_t src_
const Value& patch, size_t patch_offset,
const char* deflate_header, SinkFn sink) {
size_t expected_target_length = static_cast<size_t>(Read8(deflate_header + 32));
+ CHECK_GT(expected_target_length, 0);
int level = Read4(deflate_header + 40);
int method = Read4(deflate_header + 44);
int window_bits = Read4(deflate_header + 48);