git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 21, 2021, 15:03 UTC
Message-ID
<cover-0.2-00000000000-20210621T145819Z-avarab@gmail.com>

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
Next: Ævar Arnfjörð Bjarmason
Message 1 of 11 in “pack-objects: missing tests & --stdin-packs segfault fix”
  1. 0/2 pack-objects: missing tests & --stdin-packs segfault fixÆvar Arnfjörð Bjarmason, Jun 21, 2021
  2. 1/2 pack-objects tests: cover blindspots in stdin handlingÆvar Arnfjörð Bjarmason, Jun 21, 2021
  3. 2/2 pack-objects: fix segfault in --stdin-packs optionÆvar Arnfjörð Bjarmason, Jun 21, 2021
  4. Taylor BlauJun 21, 2021
  5. Taylor BlauJun 21, 2021
  6. 0/2 pack-objects: missing tests & --stdin-packs segfault fixÆvar Arnfjörð Bjarmason, Jul 9, 2021
  7. 1/2 pack-objects tests: cover blindspots in stdin handlingÆvar Arnfjörð Bjarmason, Jul 9, 2021
  8. 2/2 pack-objects: fix segfault in --stdin-packs optionÆvar Arnfjörð Bjarmason, Jul 9, 2021
  9. Taylor BlauJul 19, 2021
  10. Ævar Arnfjörð BjarmasonJul 20, 2021
  11. Taylor BlauJul 20, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.