diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2016-09-01 19:48:39 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-09-01 19:48:39 +0200 |
commit | 3202b8faf408908456816b51e2f0faf2cd3ff746 (patch) | |
tree | 4f116fad73bb81476238deb9a70313f54cd68246 /updater | |
parent | Merge "minadbd: rename adb_server_main to minadbd_main." (diff) | |
parent | Check an edge case when read(2) returns 0 (diff) | |
download | android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.tar android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.tar.gz android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.tar.bz2 android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.tar.lz android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.tar.xz android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.tar.zst android_bootable_recovery-3202b8faf408908456816b51e2f0faf2cd3ff746.zip |
Diffstat (limited to 'updater')
-rw-r--r-- | updater/blockimg.cpp | 4 |
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; } |