From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH] attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()
Date: Fri, 03 May 2024 12:45:38 -0700 [thread overview]
Message-ID: <xmqqfruy65nh.fsf@gitster.g> (raw)
In-Reply-To: <28f6267709db78ba526d7ed9fc4a734674697c70.1714763555.git.me@ttaylorr.com> (Taylor Blau's message of "Fri, 3 May 2024 15:12:36 -0400")
Taylor Blau <me@ttaylorr.com> writes:
> Ensure that we refuse to process a .gitattributes blob exceeding
> ATTR_MAX_FILE_SIZE when reading from either an arbitrary tree object or
> a sparse directory. This is done by pushing the ATTR_MAX_FILE_SIZE check
> down into the low-level `read_attr_from_buf()`.
>
> In doing so, plug a leak in `read_attr_from_index()` where we would
> accidentally leak the large buffer upon detecting it is too large to
> process.
>
> (Since `read_attr_from_buf()` handles a NULL buffer input, we can remove
> a NULL check before calling it in `read_attr_from_index()` as well).
>
> Co-authored-by: Jeff King <peff@peff.net>
> Signed-off-by: Jeff King <peff@peff.net>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
Makes sense. Will queue. Thanks.
next prev parent reply other threads:[~2024-05-03 19:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 19:12 [PATCH] attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf() Taylor Blau
2024-05-03 19:45 ` Junio C Hamano [this message]
2024-05-06 5:57 ` Patrick Steinhardt
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=xmqqfruy65nh.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).