mirror of https://github.com/apache/lucene.git
throw IAE in OfflineSorter if incoming blob is too big
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1593542 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e162b63759
commit
63ba0e2337
|
@ -474,9 +474,12 @@ public final class OfflineSorter {
|
|||
assert bytes != null;
|
||||
assert off >= 0 && off + len <= bytes.length;
|
||||
assert len >= 0;
|
||||
if (len > Short.MAX_VALUE) {
|
||||
throw new IllegalArgumentException("len must be <= " + Short.MAX_VALUE + "; got " + len);
|
||||
}
|
||||
os.writeShort(len);
|
||||
os.write(bytes, off, len);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the provided {@link DataOutput} if it is {@link Closeable}.
|
||||
|
|
Loading…
Reference in New Issue