0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4393: possible number overflow with nested folds

Problem:    Possible number overflow with nested folds.
Solution:   Avoid a negative line number.
This commit is contained in:
Bram Moolenaar
2022-02-15 19:15:22 +00:00
parent 64d95cfc56
commit 6b43471da4
2 changed files with 4 additions and 2 deletions

View File

@@ -1604,7 +1604,7 @@ foldMarkAdjustRecurse(
if (amount == MAXLNUM)
{
foldMarkAdjustRecurse(&fp->fd_nested,
line1 - fp->fd_top,
0,
line2 - fp->fd_top,
amount,
amount_after + (fp->fd_top - top));
@@ -1614,7 +1614,7 @@ foldMarkAdjustRecurse(
else
{
foldMarkAdjustRecurse(&fp->fd_nested,
line1 - fp->fd_top,
0,
line2 - fp->fd_top,
amount,
amount_after - amount);

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4393,
/**/
4392,
/**/