diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-15 19:15:22 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-15 19:15:22 +0000 |
commit | 6b43471da4516e8f6c17e5dc2eccbb9d0ba2e0a4 (patch) | |
tree | 30fee9597b3adb3e56699b009e26267994f5a5ab | |
parent | 64d95cfc56406858a05032c6a134f1e08fe2ca78 (diff) |
patch 8.2.4393: possible number overflow with nested foldsv8.2.4393
Problem: Possible number overflow with nested folds.
Solution: Avoid a negative line number.
-rw-r--r-- | src/fold.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/fold.c b/src/fold.c index 3f8de1c25c..33c26996fe 100644 --- a/src/fold.c +++ b/src/fold.c @@ -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); diff --git a/src/version.c b/src/version.c index e4bee84583..4cbc2972a8 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4393, +/**/ 4392, /**/ 4391, |