vim-patch:9.1.1690: Missing recursion guard in dos/unix_expandpath() (#35499)

Problem:  Missing recursion guard in dos/unix_expandpath()
Solution: Add guard variables (ashamedbit)

fixes: vim/vim#18099
closes: vim/vim#18106

e8948a1f80

Co-authored-by: ashamedbit <muralianiruddhan@gmail.com>
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
zeertzjq
2025-08-27 10:17:30 +08:00
committed by GitHub
parent 443278c587
commit b116ed7b12

View File

@@ -754,9 +754,13 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
vim_snprintf(buf + len, buflen - len, "%s", path_end);
if (path_has_exp_wildcard(path_end)) { // handle more wildcards
// need to expand another component of the path
// remove backslashes for the remaining components only
do_path_expand(gap, buf, len + 1, flags, false);
if (stardepth < 100) {
stardepth++;
// need to expand another component of the path
// remove backslashes for the remaining components only
do_path_expand(gap, buf, len + 1, flags, false);
stardepth--;
}
} else {
FileInfo file_info;