git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: peff@peff.net, chriscool@tuxfamily.org
Subject: [PATCH 0/2] upload-pack.c: fix partial clone allowed filter regression
Date: Thu, 3 Dec 2020 13:55:03 -0500	[thread overview]
Message-ID: <cover.1607021483.git.me@ttaylorr.com> (raw)

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

             reply	other threads:[~2020-12-03 18:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 18:55 Taylor Blau [this message]
2020-12-03 18:55 ` [PATCH 1/2] builtin/clone.c: don't ignore transport_fetch_refs() errors Taylor Blau
2020-12-03 18:55 ` [PATCH 2/2] upload-pack.c: don't free allowed_filters util pointers Taylor Blau
2020-12-04 21:04   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1607021483.git.me@ttaylorr.com \
    --to=me@ttaylorr.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).