All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] pack-objects: missing tests & --stdin-packs segfault fix
@ 2021-06-21 15:03 Ævar Arnfjörð Bjarmason
  2021-06-21 15:03 ` [PATCH 1/2] pack-objects tests: cover blindspots in stdin handling Ævar Arnfjörð Bjarmason
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-06-21 15:03 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Taylor Blau, Jeff King, Derrick Stolee,
	Ævar Arnfjörð Bjarmason

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/

Æ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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-07-20 16:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 15:03 [PATCH 0/2] pack-objects: missing tests & --stdin-packs segfault fix Ævar Arnfjörð Bjarmason
2021-06-21 15:03 ` [PATCH 1/2] pack-objects tests: cover blindspots in stdin handling Ævar Arnfjörð Bjarmason
2021-06-21 15:03 ` [PATCH 2/2] pack-objects: fix segfault in --stdin-packs option Ævar Arnfjörð Bjarmason
2021-06-21 20:33   ` Taylor Blau
2021-06-21 20:34 ` [PATCH 0/2] pack-objects: missing tests & --stdin-packs segfault fix Taylor Blau
2021-07-09 10:13 ` [PATCH v2 " Ævar Arnfjörð Bjarmason
2021-07-09 10:13   ` [PATCH v2 1/2] pack-objects tests: cover blindspots in stdin handling Ævar Arnfjörð Bjarmason
2021-07-09 10:13   ` [PATCH v2 2/2] pack-objects: fix segfault in --stdin-packs option Ævar Arnfjörð Bjarmason
2021-07-19 21:31     ` Taylor Blau
2021-07-20 11:55       ` Ævar Arnfjörð Bjarmason
2021-07-20 16:58         ` Taylor Blau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.