diff options
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c index 5f573d9b81..0ed23981b3 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -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); |