From: Jann Horn Date: Wed, 29 Aug 2018 20:58:57 GMT Subject: [PATCH 3/3] t5303: add tests for corrupted deltas Message-ID: <20180829205857.77340-3-jannh@google.com> In-Reply-To: <20180829205857.77340-1-jannh@google.com> This verifies the changes from commit "patch-delta: fix oob read". Signed-off-by: Jann Horn --- t/t5303-pack-corruption-resilience.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/t/t5303-pack-corruption-resilience.sh b/t/t5303-pack-corruption-resilience.sh index 3634e258f..7152376b6 100755 --- a/t/t5303-pack-corruption-resilience.sh +++ b/t/t5303-pack-corruption-resilience.sh @@ -311,4 +311,22 @@ test_expect_success \ test_must_fail git cat-file blob $blob_2 > /dev/null && test_must_fail git cat-file blob $blob_3 > /dev/null' +test_expect_success \ + 'apply good minimal delta' \ + 'printf "\x00\x01\x01X" > minimal_delta && + test-tool delta -p /dev/null minimal_delta /dev/null + ' + +test_expect_success \ + 'apply truncated delta' \ + 'printf "\x00\x02\x02X" > truncated_delta && + test_must_fail test-tool delta -p /dev/null truncated_delta /dev/null + ' + +test_expect_success \ + 'apply delta with trailing garbage command' \ + 'printf "\x00\x01\x01X\x01" > tail_garbage_delta && + test_must_fail test-tool delta -p /dev/null tail_garbage_delta /dev/null + ' + test_done -- 2.19.0.rc0.228.g281dcd1b4d0-goog