summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--streaming.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/streaming.c b/streaming.c
index 4d978e54e4..f4126a7da5 100644
--- a/streaming.c
+++ b/streaming.c
@@ -514,6 +514,8 @@ int stream_blob_to_fd(int fd, unsigned const char *sha1, struct stream_filter *f
ssize_t wrote, holeto;
ssize_t readlen = read_istream(st, buf, sizeof(buf));
+ if (readlen < 0)
+ goto close_and_exit;
if (!readlen)
break;
if (can_seek && sizeof(buf) == readlen) {