Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 14, 2010, 05:00 UTC
- Message-ID
- <AANLkTi=5QgkBd434=Z7MCA_ZNZCXVyXJYh_fd1A+B2ue@mail.gmail.com>
- In-Reply-To
- <7vlj3t35ol.fsf@alter.siamese.dyndns.org>
2010/12/14 Junio C Hamano <gitster@pobox.com>:
Show 14 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> This patch make sure that "base" parameter is writable. The callees >> are free to modify it as long as base remains the same before >> entering and after leaving the callee. >> >> This avoids quite a bit of malloc and memcpy(). >> >> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> >> --- > > I like what I see in this patch in general, but there is nothing that > guarantees that you are "reserving" enough space. Doesn't the buffer > overflow with deep enough trees?
All paths should not exceed PATH_MAX, right? That's my assumption. If it's wrong, then, well.. we need another way.
-- Duy