Author :
Weihang Lo
Date :
2026-08-12 08:32:40
Hash :5254f5dc Message :fix(zstream): fail on truncated input instead of looping forever
`inflate()` reports `Z_BUF_ERROR` when a truncated stream exhausts
its input before reaching `Z_STREAM_END`.
The stock `zstream_seterr` suggests treating that as non-fatal
so callers can retry with more input or output space.
However,
the drain loop in `git_zstream_get_output` can supply neither because
* output space is still available
* input is only refilled outside the loop
It would leads to zero-progress forever.
The problematic behavior was found in `git_odb_read`
on a truncated loose object.
The proposed fix here:
Detect the stuck state in the drain loop and report an error.