Commit Graph

4 Commits

Author SHA1 Message Date
Edward Thomson
b8dc2fdb92 zstream: fail when asked to inflate garbage
When we are provided some input buffer (with a length) to inflate,
and it contains more data than simply the deflated data, fail.
zlib will helpfully tell us when it is done reading (via Z_STREAM_END),
so if there is data leftover in the input buffer, fail lest we
continually try to inflate it.
2016-05-26 13:01:04 -05:00
Edward Thomson
b88f1713d0 zstream: offer inflating, git_zstream_inflatebuf
Introduce `git_zstream_inflatebuf` for simple uses.
2016-05-26 13:01:03 -05:00
Russell Belfer
8606f33bea Expand zstream tests and fix off-by-one error 2014-01-30 10:00:00 -08:00
Russell Belfer
d9b04d78a3 Reorganize zstream API and fix wrap problems
There were some confusing issues mixing up the number of bytes
written to the zstream output buffer with the number of bytes
consumed from the zstream input.  This reorganizes the zstream
API and makes it easier to deflate an arbitrarily large input
while still using a fixed size output.
2014-01-30 09:59:59 -08:00