summaryrefslogtreecommitdiffstats
path: root/applypatch
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-09-01 20:01:09 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-09-01 20:01:09 +0200
commit28f6c43db54159c218dd2ca27dbb775305b4011c (patch)
treece38d93bffc34e9304165aa198b24573870c2074 /applypatch
parentMerge "minadbd: rename adb_server_main to minadbd_main." am: 818394869d am: aad4cef0f3 (diff)
parentMerge "Check an edge case when read(2) returns 0" am: 3202b8faf4 (diff)
downloadandroid_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.gz
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.bz2
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.lz
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.xz
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.zst
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.zip
Diffstat (limited to 'applypatch')
-rw-r--r--applypatch/applypatch.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 02a3c6e41..e52ef99dc 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -336,6 +336,9 @@ int WriteToPartition(const unsigned char* data, size_t len, const char* target)
printf("verify read error %s at %zu: %s\n",
partition, p, strerror(errno));
return -1;
+ } else if (read_count == 0) {
+ printf("verify read reached unexpected EOF, %s at %zu\n", partition, p);
+ return -1;
}
if (static_cast<size_t>(read_count) < to_read) {
printf("short verify read %s at %zu: %zd %zu %s\n",