Skip to content

Commit 7c0c786

Browse files
committed
Prevent overflow with planetary-scale int64 position
1 parent ab3293c commit 7c0c786

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Lucene.Net/Support/Store/UnsafeChunkIndexInput.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ int ReadInt32Slow()
304304
public override long ReadInt64()
305305
{
306306
long pos = position;
307-
if (pos + 8 <= currentEnd)
307+
if (pos <= currentEnd - 8)
308308
{
309309
readerSlot.EnterCore();
310310
ulong raw = Unsafe.ReadUnaligned<ulong>(readBase + pos);

0 commit comments

Comments
 (0)