]> source.dussan.org Git - jgit.git/commit
IndexPack: Fix spurious pack file corruption errors 50/1150/1
authorShawn O. Pearce <spearce@spearce.org>
Tue, 20 Jul 2010 14:40:48 +0000 (07:40 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 20 Jul 2010 14:40:48 +0000 (07:40 -0700)
commitb518189b5c580e21c5f6d8a3b59e7f1538f0110e
tree13a93105fb2b8777312db7db09fcd9819954f2f2
parentec13e0382ab1f9d32d889068b7aeb9c2ef6a2b60
IndexPack: Fix spurious pack file corruption errors

We didn't correctly handle the zlib trailer for an object.  If the
trailer bytes were outside of the current buffer window but we had
fully inflated the object itself, we broke out of the loop (as we had
our target size) but inflate wasn't finished (as it did not yet get
the trailer) so we failed the test and threw a corruption exception.

Use an infinite loop and only break out when the inflater is done.

Change-Id: I7c9bbbeb577a990d9bc56a50ebd485935460f6c8
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java