NightOwl888 commented on issue #1090:
URL: https://github.com/apache/lucenenet/issues/1090#issuecomment-2574409708

   The cast here is potentially a problem: 
https://github.com/apache/lucenenet/blob/master/src/Lucene.Net/Store/MMapDirectory.cs#L329
   
   It can overflow `int` because the original value is `long`. We might also 
want to check the math on `nrBuffers` to make sure that is right, also. There 
were significant gaps between Java and .NET here, so we were making it up as we 
went along.
   
   One thing to note is that `length` on `ByteBuffer` is `int`, but 
`MMapDirectory` always uses `long`, so indexing into it might be overflowing 
(although, I would think the chunk size would be small enough so that isn't a 
problem). But a similar overflow problem could be creeping in because of this 
gap.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to