missing fread(3) error check in get_file_status()
diff --git a/lib/worktree.c b/lib/worktree.c
index f6e70aa..4f18b2a 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -1003,6 +1003,10 @@ get_file_status(unsigned char *status, struct stat *sb,
break;
/* Skip length of blob object header first time around. */
flen = fread(fbuf, 1, sizeof(fbuf) - hdrlen, f);
+ if (flen == 0 && ferror(f)) {
+ err = got_error_from_errno();
+ break;
+ }
if (blen == 0) {
if (flen != 0)
*status = GOT_STATUS_MODIFY;