diff --git a/tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz b/tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz new file mode 100644 index 00000000..7cf2e89f Binary files /dev/null and b/tests/misc-tests/032-bad-item-ptr/bad_item_ptr.raw.xz differ diff --git a/tests/misc-tests/032-bad-item-ptr/test.sh b/tests/misc-tests/032-bad-item-ptr/test.sh new file mode 100755 index 00000000..cfbfe1a5 --- /dev/null +++ b/tests/misc-tests/032-bad-item-ptr/test.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Verify that btrfs inspect dump-tree won't segfault on heavily corrupted +# tree leaf +# Issue: #128 + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_check "$TOP/btrfs" inspect-internal dump-tree "$1" + run_mustfail "btrfs check failed to detect such corruption" \ + "$TOP/btrfs" check "$1" +} + +check_all_images