From: Junio C Hamano Date: Fri, 11 Sep 2026 18:32:01 GMT Subject: Re: [PATCH v2 1/3] merge-ll: use strbuf to read back external merge result Message-ID: In-Reply-To: Elijah Newren 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.