mirror of https://github.com/apache/lucene.git
add missing safety check
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1580026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1c29fdb32b
commit
4b95522725
|
@ -141,6 +141,9 @@ public final class CompoundFileDirectory extends BaseDirectory {
|
|||
fileEntry.offset = entriesStream.readLong();
|
||||
fileEntry.length = entriesStream.readLong();
|
||||
}
|
||||
if (entriesStream.getFilePointer() != entriesStream.length()) {
|
||||
throw new CorruptIndexException("did not read all bytes from file \"" + entriesFileName + "\": read " + entriesStream.getFilePointer() + " vs size " + entriesStream.length() + " (resource: " + entriesStream + ")");
|
||||
}
|
||||
return mapping;
|
||||
} catch (IOException ioe) {
|
||||
priorE = ioe;
|
||||
|
|
Loading…
Reference in New Issue