Thread (11 messages) 11 messages, 2 authors, 2021-07-20

[PATCH 0/2] pack-objects: missing tests & --stdin-packs segfault fix

flat view
STALE1905d

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-06-21 15:03:46

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]
When re-rolling an unrelated series[1] dealing with pack-objects.c and
revision.c I discovered that we have some test blindspots, and that
the newly added --stdin-packs option in v2.32.0 will segfault if fed
garbage data.

This fixes the test blindspots, and 2/2 fixes the segfault.

As discussed in its commit message I'm being lazy about emitting the
error message. If you supply N bogus lines on stdin we'll error on the
first one, since the input is first sorted by the string-list.c
API. The test case for the error message relies on which of two SHA
lines sorts first, and I picked input that happens to sort the same
way under both SHA-1 and SHA-256.

Lazy, but I figured for this use-case it wasn't worth keeping track of
what line we saw when, or to refactor the parsing check on pack names
as we get input lines.

1. https://lore.kernel.org/git/cover-0.4-0000000000-20210617T105537Z-avarab@gmail.com/ (local)

Ævar Arnfjörð Bjarmason (2):
  pack-objects tests: cover blindspots in stdin handling
  pack-objects: fix segfault in --stdin-packs option

 builtin/pack-objects.c |  10 ++++
 t/t5300-pack-object.sh | 103 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)

-- 
2.32.0.599.g3967b4fa4ac
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help