Sfoglia il codice sorgente

Merge "Don't copy more than the object size"

tags/v0.9.1
Chris Aniszczyk 13 anni fa
parent
commit
f74d474f3c

+ 3
- 3
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java Vedi File

@@ -169,14 +169,14 @@ public abstract class ObjectLoader {
final long sz = in.getSize();
byte[] tmp = new byte[1024];
long copied = 0;
for (;;) {
while (copied < sz) {
int n = in.read(tmp);
if (n < 0)
break;
throw new EOFException();
out.write(tmp, 0, n);
copied += n;
}
if (copied != sz)
if (0 <= in.read())
throw new EOFException();
} finally {
in.close();

Loading…
Annulla
Salva