remote-bzr: fix utf-8 support for fetching
[gitweb.git] / sha1_file.c
index 5f573d9b8107720b1a4f5c1da63a2d8e5b4369cf..0ed23981b363a07c6f4c5b930b1a5991d5c8a622 100644 (file)
@@ -1271,6 +1271,10 @@ int check_sha1_signature(const unsigned char *sha1, void *map,
                char buf[1024 * 16];
                ssize_t readlen = read_istream(st, buf, sizeof(buf));
 
+               if (readlen < 0) {
+                       close_istream(st);
+                       return -1;
+               }
                if (!readlen)
                        break;
                git_SHA1_Update(&c, buf, readlen);