]> source.dussan.org Git - jgit.git/commit
Don't copy more than the object size 97/1397/2
authorShawn O. Pearce <spearce@spearce.org>
Tue, 24 Aug 2010 19:59:10 +0000 (12:59 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 25 Aug 2010 00:37:07 +0000 (17:37 -0700)
commit7cfe2f12ff399581f9e205adc3a49bc240a3932a
tree5fc67a117b9ebf8c8c7cfcf1a8529a0db71305e4
parentb474de1da381174b0f769c4e1541cd39e5016572
Don't copy more than the object size

If the loader's stream is broken and returns to us more content
than it originally declared as the size of the object, don't
copy that onto the output stream.  Instead throw EOFException
and abort fast.  This way we don't follow an infinite stream,
but instead will at least stop when the size was reached.

Change-Id: I7ec0c470c875f03b1f12a74a9b4d2f6e73b659bb
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java