diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-06-18 11:23:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-18 11:23:22 -0700 |
commit | f35f43f565c99d5cbbac210b82448d9f445c9607 (patch) | |
tree | b03ce86ff4b83a5a3d57675862308310413ae959 /t | |
parent | 1663e2ba6863afa949dd84b3286b52290049daa9 (diff) | |
parent | 1140bf01ecf4a49c32b3c385dd782cd183e730af (diff) | |
download | git-f35f43f565c99d5cbbac210b82448d9f445c9607.tar.gz |
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')
-rwxr-xr-x | t/t5310-pack-bitmaps.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5310-pack-bitmaps.sh b/t/t5310-pack-bitmaps.sh index 423c0a475f..2d22a17c4a 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 |