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

[PATCH 0/2] upload-pack.c: fix partial clone allowed filter regression

From
Taylor Blau <me@ttaylorr.com>
Date
Dec 3, 2020, 18:55 UTC
Message-ID
<cover.1607021483.git.me@ttaylorr.com>
Hi,

Here's a regression fix that I noticed this morning while deploying 2.28 out to GitHub. The gist is that we accidentally call 'string_list_clear(..., 1)' when freeing the list of allowed/banned object filters, but the ->util pointer either contains '0', or '1'. So, the free() of the util pointer is bogus, and we end up crashing.

The fix in the second patch is straightforward, but it doesn't work without the first patch, which teaches 'git clone' to match 'git fetch' and not ignore an error from 'transport_fetch_refs()'.

Unfortunately, this regression has been in Git since 2.28. Fortunately, nobody has seemed to notice, so I doubt that it's bitten anybody out in the wild. But, it's still worth fixing, since it is so obviously broken.

Thanks, Taylor

Taylor Blau (2):
  builtin/clone.c: don't ignore transport_fetch_refs() errors
  upload-pack.c: don't free allowed_filters util pointers
 builtin/clone.c          | 15 +++++++++++----
 t/t5616-partial-clone.sh | 10 +++++++++-
 upload-pack.c            |  2 +-
 3 files changed, 21 insertions(+), 6 deletions(-)

-- 2.29.2.533.g07db1f5344

Next: Taylor Blau
Message 1 of 4 in “upload-pack.c: fix partial clone allowed filter regression”
  1. 0/2 upload-pack.c: fix partial clone allowed filter regressionTaylor Blau, Dec 3, 2020
  2. 2/2 upload-pack.c: don't free allowed_filters util pointersTaylor Blau, Dec 3, 2020
  3. Jeff KingDec 4, 2020
  4. 1/2 builtin/clone.c: don't ignore transport_fetch_refs() errorsTaylor Blau, Dec 3, 2020

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.