mirror of
https://github.com/apache/lucene.git
synced 2025-03-01 13:59:12 +00:00
LUCENE-1519: upcast to long to prevent overflow
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@734415 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
88e19ab531
commit
888af0337d
@ -374,7 +374,7 @@ final class SegmentMerger {
|
||||
|
||||
final long fdxFileLength = directory.fileLength(segment + "." + IndexFileNames.FIELDS_INDEX_EXTENSION);
|
||||
|
||||
if (4+docCount*8 != fdxFileLength)
|
||||
if (4+((long) docCount)*8 != fdxFileLength)
|
||||
// This is most likely a bug in Sun JRE 1.6.0_04/_05;
|
||||
// we detect that the bug has struck, here, and
|
||||
// throw an exception to prevent the corruption from
|
||||
@ -468,7 +468,7 @@ final class SegmentMerger {
|
||||
|
||||
final long tvxSize = directory.fileLength(segment + "." + IndexFileNames.VECTORS_INDEX_EXTENSION);
|
||||
|
||||
if (4+mergedDocs*16 != tvxSize)
|
||||
if (4+((long) mergedDocs)*16 != tvxSize)
|
||||
// This is most likely a bug in Sun JRE 1.6.0_04/_05;
|
||||
// we detect that the bug has struck, here, and
|
||||
// throw an exception to prevent the corruption from
|
||||
|
Loading…
x
Reference in New Issue
Block a user