]> source.dussan.org Git - jgit.git/commit
Check that DfsBlockCache#blockSize is a power of 2 69/84569/5
authorPhilipp Marx <smigfu@googlemail.com>
Fri, 11 Nov 2016 09:43:09 +0000 (10:43 +0100)
committerPhilipp Marx <smigfu@googlemail.com>
Fri, 11 Nov 2016 09:43:09 +0000 (10:43 +0100)
commit8adbfe4da6723768febbb86c22ac118e233c2154
tree2ffe1b2ecf24714b5463e0f5b7a765df5f957b6c
parentf8ac03459a96138cc9cf8578933a946fb1f179f3
Check that DfsBlockCache#blockSize is a power of 2

In case a value is used which isn’t a power of 2 there will be a high
chance of java.lang.ArrayIndexOutBoundsException and
org.eclipse.jgit.errors.CorruptObjectException due to a mismatching
assumption for the DfsBlockCache#blockSizeShift parameter.

Change-Id: Ib348b3704edf10b5f93a3ffab4fa6f09cbbae231
Signed-off-by: Philipp Marx <smigfu@googlemail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfigTest.java [new file with mode: 0644]
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheConfig.java