From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"René Scharfe" <l.s.r@web.de>,
"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH 0/2] tree-walk: use size_t for tree sizes
Date: Tue, 17 Nov 2026 22:42:53 +0100 [thread overview]
Message-ID: <20261117214253.716770-1-gitter.spiros@gmail.com> (raw)
In-Reply-To: <cover.1793357680.git.gitter.spiros@gmail.com>
Hi,
A gentle ping on this two-patch series, which has not had any comments
so far. It still applies cleanly to current master (e1ec09b23c), and
nothing has touched tree-walk.[ch] or tree.[ch] since it was sent.
To recap briefly: struct tree_desc keeps the size of the tree buffer in
an "unsigned int", so on every platform a tree of 4GiB or more is seen
only up to "size mod 2^32". The walk never reads past the buffer, but
when the cut falls between two entries the rest of the tree silently
disappears, for "git ls-tree" as well as for the checks in fsck_tree().
2/2 does the same for struct tree, which matters only where "long" has
32 bits while size_t has 64, as on Windows.
I would appreciate an opinion on two questions:
- Is this worth fixing at all, given that such a tree can only be
crafted on purpose?
- If it is, is widening the types the right approach, or should a
tree too large for the walker rather be rejected, e.g. in
init_tree_desc_gently(), which fsck_tree() also uses?
If there is no interest, I am happy to drop the series.
Thanks,
Elia
prev parent reply other threads:[~2026-11-17 21:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 10:58 [PATCH 0/2] tree-walk: use size_t for tree sizes Elia Pinto
2026-10-30 10:58 ` [PATCH 1/2] tree-walk: use size_t for the size of tree buffers Elia Pinto
2026-11-18 2:32 ` Junio C Hamano
2026-10-30 10:58 ` [PATCH 2/2] tree: use size_t for the size of parsed trees Elia Pinto
2026-11-18 3:47 ` Junio C Hamano
2026-11-17 21:42 ` Elia Pinto [this message]
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=20261117214253.716770-1-gitter.spiros@gmail.com \
--to=gitter.spiros@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=ebiederm@xmission.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--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