]> source.dussan.org Git - jgit.git/commit
dfs: Fix DataFormatException: 0 bytes to inflate 00/101600/2
authorShawn Pearce <spearce@spearce.org>
Wed, 19 Jul 2017 21:20:23 +0000 (14:20 -0700)
committerShawn Pearce <spearce@spearce.org>
Wed, 19 Jul 2017 21:28:59 +0000 (14:28 -0700)
commitf414f7de1fcfa6edf3cd18d38602d9d85d9133c9
tree8e78b9b7c08f4595efb52ab9260e05c11b9ffd45
parentda0a7c1f3cb580065ab45577ced06f88ab0afb42
dfs: Fix DataFormatException: 0 bytes to inflate

When a file uses a different block size (e.g.  500) than the cache
(e.g.  512), and the DfsPackFile's blockSize field has not been
initialized, the cache misaligns block loads.  The cache uses its
default of 512 to compute the block alignment instead of the file's
500.

This causes DfsReader try to set an empty range into an Inflater,
resulting in an object being unable to load.

Change-Id: I7d6352708225f62ef2f216d1ddcbaa64be113df6
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsBlockCacheTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java