Browse Source

Merge "PackIndexV2: fix possibly wrong check"

tags/v3.5.0.201409071800-rc1
Shawn Pearce 9 years ago
parent
commit
7b28130758

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndexV2.java View File

} }


final long nameLen = bucketCnt * Constants.OBJECT_ID_LENGTH; final long nameLen = bucketCnt * Constants.OBJECT_ID_LENGTH;
if (nameLen > Integer.MAX_VALUE)
if (nameLen > Integer.MAX_VALUE - 8) // see http://stackoverflow.com/a/8381338
throw new IOException(JGitText.get().indexFileIsTooLargeForJgit); throw new IOException(JGitText.get().indexFileIsTooLargeForJgit);


final int intNameLen = (int) nameLen; final int intNameLen = (int) nameLen;

Loading…
Cancel
Save