From: René Scharfe Date: Fri, 11 May 2012 14:53:07 +0000 (+0200) Subject: dir: respect string length argument of read_directory_recursive() X-Git-Tag: v1.7.11-rc0~3^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1528d247e53bcf33db5b004a25a7d9b8c75c90e4?hp=1528d247e53bcf33db5b004a25a7d9b8c75c90e4 dir: respect string length argument of read_directory_recursive() A directory name is passed to read_directory_recursive() as a length-limited string, through the parameters base and baselen. Suprisingly, base must be a NUL-terminated string as well, as it is passed to opendir(), ignoring baselen. Fix this by postponing the call to opendir() until the length-limted string is added to a strbuf, which provides a NUL in the right place. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano ---