summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-31 04:12:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-31 04:12:12 (GMT)
commit18ad13e5b2ee18c3f57bf41add3efa95980e72c1 (patch)
treef1125513a85c95243b7f5706c74e34e49aa492c6 /sha1-file.c
parentcae598d9980661a978e2df4fb338518f7bf09572 (diff)
parent98f425b453870cdb20b4bf8daa29f52af8e59866 (diff)
downloadgit-18ad13e5b2ee18c3f57bf41add3efa95980e72c1.zip
git-18ad13e5b2ee18c3f57bf41add3efa95980e72c1.tar.gz
git-18ad13e5b2ee18c3f57bf41add3efa95980e72c1.tar.bz2
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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sha1-file.c b/sha1-file.c
index 97b7423..6d6c3af 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)