Skip to content

Commit 50b72ed

Browse files
peffgitster
authored andcommitted
t5303: drop "count=1" from corruption dd
This test corrupts pack objects by using "dd" with a seek command. It passes "count=1 bs=1" to munge just a single byte. However, the test added in commit b3118bd wants to munge two bytes, and the second byte of corruption is silently ignored. This turned out not to impact the test, however. The idea was to reduce the "size of this entry" part of the header so that zlib runs out of input bytes while inflating the entry. That header is two bytes long, and the test reduced the value of both bytes; since we experience the problem if we are off by even 1 byte, it is sufficient to munge only the first one. Even though the test would have worked with only a single byte munged, and we could simply tweak the test to use a single byte, it makes sense to lift this 1-byte restriction from do_corrupt_object. It will allow future tests that do need to change multiple bytes to do so. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2b4626 commit 50b72ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t5303-pack-corruption-resilience.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ do_corrupt_object() {
5151
ofs=`git show-index < ${pack}.idx | grep $1 | cut -f1 -d" "` &&
5252
ofs=$(($ofs + $2)) &&
5353
chmod +w ${pack}.pack &&
54-
dd of=${pack}.pack count=1 bs=1 conv=notrunc seek=$ofs &&
54+
dd of=${pack}.pack bs=1 conv=notrunc seek=$ofs &&
5555
test_must_fail git verify-pack ${pack}.pack
5656
}
5757

0 commit comments

Comments
 (0)