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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user