Skip to content

Commit d16b019

Browse files
committed
Port commit 9d10d6f92cc for Lucene 4.8.1 (no JIRA number)
1 parent c978aaa commit d16b019

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Lucene.Net/Util/OfflineSorter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,10 @@ public virtual void Write(byte[] bytes, int off, int len)
683683
if (off > bytes.Length - len) // Checks for int overflow
684684
throw new ArgumentException("Index and length must refer to a location within the array.");
685685

686+
// Lucene 4.8.1 commit 9d10d6f92cc (no JIRA number given)
687+
if (len > short.MaxValue)
688+
throw new ArgumentOutOfRangeException(nameof(len), $"len must be <= {short.MaxValue}; got {len}");
689+
686690
os.Write((short)len);
687691
os.Write(bytes, off, len);
688692
}

0 commit comments

Comments
 (0)