summaryrefslogtreecommitdiff
path: root/t/t5310-pack-bitmaps.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-18 18:23:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-18 18:23:22 (GMT)
commitf35f43f565c99d5cbbac210b82448d9f445c9607 (patch)
treeb03ce86ff4b83a5a3d57675862308310413ae959 /t/t5310-pack-bitmaps.sh
parent1663e2ba6863afa949dd84b3286b52290049daa9 (diff)
parent1140bf01ecf4a49c32b3c385dd782cd183e730af (diff)
downloadgit-f35f43f565c99d5cbbac210b82448d9f445c9607.zip
git-f35f43f565c99d5cbbac210b82448d9f445c9607.tar.gz
git-f35f43f565c99d5cbbac210b82448d9f445c9607.tar.bz2
Merge branch 'jk/ewah-bounds-check'
The code to read compressed bitmap was not careful to avoid reading past the end of the file, which has been corrected. * jk/ewah-bounds-check: ewah: adjust callers of ewah_read_mmap() ewah_read_mmap: bounds-check mmap reads
Diffstat (limited to 't/t5310-pack-bitmaps.sh')
-rwxr-xr-xt/t5310-pack-bitmaps.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh
index 423c0a4..2d22a17 100755
--- a/t/t5310-pack-bitmaps.sh
+++ b/t/t5310-pack-bitmaps.sh
@@ -331,4 +331,17 @@ test_expect_success 'pack reuse respects --incremental' '
git show-index <empty.idx >actual &&
test_cmp expect actual
'
+
+test_expect_success 'truncated bitmap fails gracefully' '
+ git repack -ad &&
+ git rev-list --use-bitmap-index --count --all >expect &&
+ bitmap=$(ls .git/objects/pack/*.bitmap) &&
+ test_when_finished "rm -f $bitmap" &&
+ head -c 512 <$bitmap >$bitmap.tmp &&
+ mv -f $bitmap.tmp $bitmap &&
+ git rev-list --use-bitmap-index --count --all >actual 2>stderr &&
+ test_cmp expect actual &&
+ test_i18ngrep corrupt stderr
+'
+
test_done