Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 13, 2010, 18:10 UTC
- Message-ID
- <7vlj3t35ol.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1292233616-27692-10-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
Show 8 quoted lines
> 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?