From: Junio C Hamano Date: Tue, 15 Apr 2025 20:50:13 +0000 (-0700) Subject: Merge branch 'jk/zlib-inflate-fixes' X-Git-Tag: v2.50.0-rc0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c39e5cbaa5e791292e90779a67e0e2fc356e9460;p=thirdparty%2Fgit.git Merge branch 'jk/zlib-inflate-fixes' Fix our use of zlib corner cases. * jk/zlib-inflate-fixes: unpack_loose_rest(): rewrite return handling for clarity unpack_loose_rest(): simplify error handling unpack_loose_rest(): never clean up zstream unpack_loose_rest(): avoid numeric comparison of zlib status unpack_loose_header(): avoid numeric comparison of zlib status git_inflate(): skip zlib_post_call() sanity check on Z_NEED_DICT unpack_loose_header(): fix infinite loop on broken zlib input unpack_loose_header(): report headers without NUL as "bad" unpack_loose_header(): simplify next_out assignment loose_object_info(): BUG() on inflating content with unknown type --- c39e5cbaa5e791292e90779a67e0e2fc356e9460 diff --cc object-file.c index 4fb3cd9dcb,e463b4bad3..8da62fed0b --- a/object-file.c +++ b/object-file.c @@@ -3077,10 -2731,9 +3077,9 @@@ static int check_stream_oid(git_zstrea if (size - total_read < stream->avail_out) stream->avail_out = size - total_read; status = git_inflate(stream, Z_FINISH); - the_hash_algo->update_fn(&c, buf, stream->next_out - buf); + git_hash_update(&c, buf, stream->next_out - buf); total_read += stream->next_out - buf; } - git_inflate_end(stream); if (status != Z_STREAM_END) { error(_("corrupt loose object '%s'"), oid_to_hex(expected_oid));