From: Ingo Molnar Date: Mon, 18 Apr 2005 08:28:27 GMT Subject: Re: [patch] git: fix 1-byte overflow in show-files.c Message-ID: <20050418082827.GA21612@elte.hu> In-Reply-To: <20050417235920.GY1461@pasky.ji.cz> * Petr Baudis wrote: > > will attempt to append a "/" string to the directory name - resulting in > > a 1-byte overflow (a zero byte is written to offset 4097, which is > > outside the array). > > The name ends precisely at offset 4095 with its NUL character: > > {PATH_MAX} > Maximum number of bytes in a pathname, including the terminating > null character. > [ http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html ] > > So, if I'm not mistaken, '/' will be written at offset 4095 instead of > the NUL and the NUL will be written at 4096. Everything's fine, right? yeah, you are right - ignore this patch. Ingo