summaryrefslogtreecommitdiff
path: root/t/t5319/no-objects.midx
diff options
context:
space:
mode:
authorLibravatar Damien Robert <damien.olivier.robert@gmail.com>2020-03-28 23:18:22 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-03-28 16:50:40 -0700
commit796d61cdc09c8f3068403965531f27fd11c739e9 (patch)
treee64c267961f2d46d417031d9ae8bfdc71b8e678e /t/t5319/no-objects.midx
parentGit 2.26 (diff)
downloadtgif-796d61cdc09c8f3068403965531f27fd11c739e9.tar.xz
midx.c: fix an integer underflow
When verifying a midx index with 0 objects, the m->num_objects - 1 underflows and wraps around to 4294967295. Fix this both by checking that the midx contains at least one oid, and also that we don't write any midx when there is no packfiles. Update the tests to check that `git multi-pack-index write` does not write an midx when there is no objects, and another to check that `git multi-pack-index verify` warns when it verifies an midx with no objects. For this last test, use t5319/no-objects.midx which was generated by an older version of git. Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5319/no-objects.midx')
-rw-r--r--t/t5319/no-objects.midxbin0 -> 1116 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/t/t5319/no-objects.midx b/t/t5319/no-objects.midx
new file mode 100644
index 0000000000..e466b8e086
--- /dev/null
+++ b/t/t5319/no-objects.midx
Binary files differ