]> granicus.if.org Git - vim/commitdiff
patch 8.2.4393: possible number overflow with nested folds v8.2.4393
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Feb 2022 19:15:22 +0000 (19:15 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Feb 2022 19:15:22 +0000 (19:15 +0000)
Problem:    Possible number overflow with nested folds.
Solution:   Avoid a negative line number.

src/fold.c
src/version.c

index 3f8de1c25c6144128f89f2025a3ee15e613a25de..33c26996fee6fec1e99aeccdc065dc5c1b510cd7 100644 (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);
index e4bee845838a1dfa5bd701e737bf4f5cfa2397d7..4cbc2972a84088b466e6d9f53713f5e7c61e33e4 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4393,
 /**/
     4392,
 /**/