From: Junio C Hamano Date: Fri, 31 Mar 2017 19:35:21 GMT Subject: Re: [PATCH] name-hash: fix buffer overrun Message-ID: In-Reply-To: <20170331173214.47514-2-git@jeffhostetler.com> git@jeffhostetler.com writes: > From: Kevin Willford > > Add check for the end of the entries for the thread partition. > Add test for lazy init name hash with specific directory structure > > The lazy init hash name was causing a buffer overflow when the last > entry in the index was multiple folder deep with parent folders that > did not have any files in them. > > This adds a test for the boundary condition of the thread partitions > with the folder structure that was triggering the buffer overflow. > > The fix was to check if it is the last entry for the thread partition > in the handle_range_dir and not try to use the next entry in the cache. > > Signed-off-by: Kevin Willford > Signed-off-by: Johannes Schindelin > Signed-off-by: Jeff Hostetler > > --- Will queue with ... > name-hash.c | 4 +++- > t/t3008-ls-files-lazy-init-name-hash.sh | 19 +++++++++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > create mode 100644 t/t3008-ls-files-lazy-init-name-hash.sh ... this thing fixed by "chmod +x" (otherwise the tests won't start). Thanks.