Closed GoogleCodeExporter closed 9 years ago
I have fixed it for now:
protected void closeCurrentEntry() throws IOException {
if (currentEntry != null) {
if (currentEntry.getSize() > currentFileSize) {
// Not fully read, skip rest of the bytes
long bs = 0;
while (bs < currentEntry.getSize() - currentFileSize) {
long res = skip( currentEntry.getSize() - currentFileSize - bs );
if (res == 0 && currentEntry.getSize() - currentFileSize > 0)
{
// I suspect file corruption
throw new IOException( "Possible tar file corruption" );
}
bs += res;
}
}
currentEntry = null;
currentFileSize = 0L;
skipPad();
}
}
That new if statement probably needs to be checked properly but I think it
works.
The read (inside skip(long n)) returns a -1 that is broken out of the while
loop. So the return value for skip is zero. If skip is returning zero, yet
there is apparently more to read then I think there is a problem with the tar
file.
Original comment by markus.d...@gmail.com
on 10 Apr 2012 at 2:15
Original comment by xeus....@gmail.com
on 1 May 2012 at 3:06
Original comment by xeus....@gmail.com
on 1 May 2012 at 9:13
v1.1
Original comment by xeus....@gmail.com
on 1 May 2012 at 9:14
Original issue reported on code.google.com by
markus.d...@gmail.com
on 10 Apr 2012 at 1:25Attachments: