diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-10-31 07:12:12 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-31 07:12:12 +0300 |
commit | 18ad13e5b2ee18c3f57bf41add3efa95980e72c1 (patch) | |
tree | f1125513a85c95243b7f5706c74e34e49aa492c6 /sha1-file.c | |
parent | cae598d9980661a978e2df4fb338518f7bf09572 (diff) | |
parent | 98f425b453870cdb20b4bf8daa29f52af8e59866 (diff) |
Adjust for 2.19.x series
* jk/detect-truncated-zlib-input
cat-file: handle streaming failures consistently
check_stream_sha1(): handle input underflow
t1450: check large blob in trailing-garbage test
Diffstat (limited to 'sha1-file.c')
-rw-r--r-- | sha1-file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1-file.c b/sha1-file.c index 97b7423848..6d6c3af659 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -2191,7 +2191,8 @@ static int check_stream_sha1(git_zstream *stream, * see the comment in unpack_sha1_rest for details. */ while (total_read <= size && - (status == Z_OK || status == Z_BUF_ERROR)) { + (status == Z_OK || + (status == Z_BUF_ERROR && !stream->avail_out))) { stream->next_out = buf; stream->avail_out = sizeof(buf); if (size - total_read < stream->avail_out) |