Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] NegativeArraySizeException in PackIndexV2

Any ideas regarding this error? Our jgit is based on 3.3.x.

java.lang.NegativeArraySizeException
	at
org.eclipse.jgit.internal.storage.file.PackIndexV2.<init>(PackIndexV2.java:123)
	at
org.eclipse.jgit.internal.storage.file.PackIndex.read(PackIndex.java:137)
	at org.eclipse.jgit.internal.storage.file.PackIndex.open(PackIndex.java:96)



The offending code is:

final long nameLen = bucketCnt * Constants.OBJECT_ID_LENGTH;
if (nameLen > Integer.MAX_VALUE)
  throw new IOException(JGitText.get().indexFileIsTooLargeForJgit);

final int intNameLen = (int) nameLen;
>>> final byte[] raw = new byte[intNameLen];

-Marc


Back to the top