stream_blob_to_fd: detect errors reading from stream
[gitweb.git] / streaming.c
index 4d978e54e4fb9d84e81977539ffa083534ef2968..f4126a7da5fb915b3d1df857b39ca9ab0ab6fb16 100644 (file)
@@ -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) {