From: Junio C Hamano Date: Mon, 13 Dec 2010 18:10:02 GMT Subject: Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation 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 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 > --- 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?