summaryrefslogtreecommitdiffstats
path: root/updater
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-09-01 19:55:08 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-09-01 19:55:08 +0200
commit0ae9d800825e30670d0db8038d41af46103c8220 (patch)
tree7f25f42263857f91cb7cd00275a7e38f4c7ae8b1 /updater
parentMerge "minadbd: rename adb_server_main to minadbd_main." am: 818394869d (diff)
parentMerge "Check an edge case when read(2) returns 0" (diff)
downloadandroid_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.tar
android_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.tar.gz
android_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.tar.bz2
android_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.tar.lz
android_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.tar.xz
android_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.tar.zst
android_bootable_recovery-0ae9d800825e30670d0db8038d41af46103c8220.zip
Diffstat (limited to 'updater')
-rw-r--r--updater/blockimg.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index f00bc4bff..0caa1acbd 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -151,6 +151,10 @@ static int read_all(int fd, uint8_t* data, size_t size) {
failure_type = kFreadFailure;
fprintf(stderr, "read failed: %s\n", strerror(errno));
return -1;
+ } else if (r == 0) {
+ failure_type = kFreadFailure;
+ fprintf(stderr, "read reached unexpected EOF.\n");
+ return -1;
}
so_far += r;
}