Re: Public repro case! Re: [PATCH/RFC] Allow writing loose objects that are corrupted in a pack file
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jan 8, 2009, 03:06 UTC
- Message-ID
- <alpine.LFD.2.00.0901071904380.3283@localhost.localdomain>
- In-Reply-To
- <20090108030115.GF10790@spearce.org>
On Wed, 7 Jan 2009, Shawn O. Pearce wrote:
Show 8 quoted lines
> > Ok, well, in this case I've been able to reproduce a zlib inflate > failure on the base object in a 2 deep delta chain. We got back: > > #define Z_STREAM_ERROR (-2) > > this causes the buffer to be freed and NULL to come back out of > unpack_compressed_entry(), and then everything is corrupt...
I bet you actually got an earlier error already from the inflateInit.
The Z_STREAM_ERROR probably comes from inflate() itself - and could very easily be due to a allocation error in inflateInit leaving the stream data incomplete.
Let me try wrapping that dang thing and send a patch.
Linus