avoid ArrayIndexOutOfBoundsException in method refill() when bufferLength gets a negativ value. It happens when TermVectorsReader.get(int docID) is used with a docID larger than number of documents stored in the index.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bernhard Messer 2004-11-28 13:33:55 +00:00
parent cedcddf4c6
commit 16552ede59
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ public abstract class BufferedIndexInput extends IndexInput {
if (end > length()) // don't read past EOF
end = length();
bufferLength = (int)(end - start);
if (bufferLength == 0)
if (bufferLength <= 0)
throw new IOException("read past EOF");
if (buffer == null)