Re: [PATCH 04/22] reftable/basics: handle allocation failures in `reftable_calloc()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 24, 2024, 06:02 UTC
- Message-ID
- <ZvJWCauoFpjYcpKs@pks.im>
- In-Reply-To
- <ZvJSyT8OsUVLln4A@pks.im>
On Tue, Sep 24, 2024 at 07:48:57AM +0200, Patrick Steinhardt wrote:
Show 20 quoted lines
> On Sat, Sep 21, 2024 at 12:37:26PM -0700, Junio C Hamano wrote: > > Patrick Steinhardt <ps@pks.im> writes: > > In a sense, it is on the borderline to handle st_mult() overflow in > > this function for a topic whose theme is about allocation failures. > > > > From the point of view of callers of reftable_calloc(), whether the > > arguments they are feeding the function is too large to be > > multiplied or whether the request is too big for the underlying > > allocator to handle, the end result should be the same: they > > requested too large an allocation. > > > > So I wouldn't complain that it is out of scope, if use of st_mult() > > that computes the allocation size is fixed as part of this series. > > But as I already said, I am also OK if we leave it to a separate > > series to tackle other potential callers of die(). > > I'd leave it as-is for now, but I do have it on my agenda to address > this, as well. I already have it as part of my third patch series in > this context where I completely detangle the reftable library from the > rest of Git to make it a reusable library for libgit2 and the likes.
Well, you know. I reroll the series anyway, so I'll just make the change now.
Patrick