From: Nguyen Thai Ngoc Duy Date: Tue, 14 Dec 2010 05:00:11 GMT Subject: Re: [PATCH 09/19] tree-diff.c: reserve space in "base" for pathname concatenation Message-ID: In-Reply-To: <7vlj3t35ol.fsf@alter.siamese.dyndns.org> 2010/12/14 Junio C Hamano : > 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? All paths should not exceed PATH_MAX, right? That's my assumption. If it's wrong, then, well.. we need another way. -- Duy