patch 9.1.1690: Missing recursion guard in dos/unix_expandpath()
Problem: Missing recursion guard in dos/unix_expandpath() Solution: Add guard variables (ashamedbit) fixes: #18099 closes: #18106 Co-authored-by: Hirohito Higashi <h.east.727@gmail.com> Signed-off-by: ashamedbit <muralianiruddhan@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
540480697d
commit
e8948a1f80
@ -3709,9 +3709,14 @@ dos_expandpath(
|
|||||||
vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
|
vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
|
||||||
if (mch_has_exp_wildcard(path_end))
|
if (mch_has_exp_wildcard(path_end))
|
||||||
{
|
{
|
||||||
// need to expand another component of the path
|
if (stardepth < 100)
|
||||||
// remove backslashes for the remaining components only
|
{
|
||||||
(void)dos_expandpath(gap, buf, len + 1, flags, FALSE);
|
// need to expand another component of the path
|
||||||
|
// remove backslashes for the remaining components only
|
||||||
|
++stardepth;
|
||||||
|
(void)dos_expandpath(gap, buf, len + 1, flags, FALSE);
|
||||||
|
--stardepth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3950,9 +3955,14 @@ unix_expandpath(
|
|||||||
vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
|
vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
|
||||||
if (mch_has_exp_wildcard(path_end)) // handle more wildcards
|
if (mch_has_exp_wildcard(path_end)) // handle more wildcards
|
||||||
{
|
{
|
||||||
// need to expand another component of the path
|
if (stardepth < 100)
|
||||||
// remove backslashes for the remaining components only
|
{
|
||||||
(void)unix_expandpath(gap, buf, len + 1, flags, FALSE);
|
// need to expand another component of the path
|
||||||
|
// remove backslashes for the remaining components only
|
||||||
|
++stardepth;
|
||||||
|
(void)unix_expandpath(gap, buf, len + 1, flags, FALSE);
|
||||||
|
--stardepth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -724,6 +724,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1690,
|
||||||
/**/
|
/**/
|
||||||
1689,
|
1689,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user