From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: "Jeff King" <peff@peff.net>, "Michal Koutný" <mkoutny@suse.com>,
git@vger.kernel.org, "Jean Delvare" <jdelvare@suse.de>,
"Usman Akinyemi" <usmanakinyemi202@gmail.com>,
"Taylor Blau" <me@ttaylorr.com>, "René Scharfe" <l.s.r@web.de>
Subject: Re: [PATCH v2 1/3] merge-ll: use strbuf to read back external merge result
Date: Fri, 11 Sep 2026 11:32:01 -0700 [thread overview]
Message-ID: <xmqq33vfbpwe.fsf@gitster.g> (raw)
In-Reply-To: <CABPp-BG9Hkc7i_JxAbYfyzu+b4Mc_pZUr0jJF=vY0jHSARpHzw@mail.gmail.com> (Elijah Newren's message of "Fri, 11 Sep 2026 11:06:33 -0700")
Elijah Newren <newren@gmail.com> writes:
> The old code narrows before xmallocz() , so it requests an impossibly
> large allocation and dies. The new code allocates the actual buffer
> first, then records a negative size; callers converting that size back
> to size_t could read past the allocation.
>
> Would a simple fail-fast make sense?
>
> if (result_buf.len > LONG_MAX)
> die(_("external merge result is too large"));
Intereting find. That does sound sensible.
next prev parent reply other threads:[~2026-09-11 18:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 15:06 [PATCH] merge-ll: Cleanup merge driver temporaries after interrupt Michal Koutný
2026-09-10 16:22 ` Jeff King
2026-09-11 14:43 ` Michal Koutný
2026-09-11 17:10 ` [PATCH v2 0/3] merge-ll: Cleanup merge driver temporaries after Jeff King
2026-09-11 17:11 ` [PATCH v2 1/3] merge-ll: use strbuf to read back external merge result Jeff King
2026-09-11 18:06 ` Elijah Newren
2026-09-11 18:32 ` Junio C Hamano [this message]
2026-09-11 17:11 ` [PATCH v2 2/3] merge-ll: catch close() errors when writing external tempfiles Jeff King
2026-09-11 18:06 ` Elijah Newren
2026-09-11 17:13 ` [PATCH v2 3/3] merge-ll: use tempfile API for external driver files Jeff King
2026-09-11 18:10 ` Elijah Newren
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=xmqq33vfbpwe.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jdelvare@suse.de \
--cc=l.s.r@web.de \
--cc=me@ttaylorr.com \
--cc=mkoutny@suse.com \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=usmanakinyemi202@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.