]> granicus.if.org Git - vim/commitdiff
patch 8.2.4364: MS-Windows: still running out of memory for a very long line v8.2.4364
authorBram Moolenaar <Bram@vim.org>
Sat, 12 Feb 2022 21:59:51 +0000 (21:59 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 Feb 2022 21:59:51 +0000 (21:59 +0000)
Problem:    MS-Windows: still running out of memory for a very long line.
Solution:   Check for negative length.

src/indent.c
src/version.c

index 3148495db1563fbe23d4504387b5b130d151b87d..95fc74ee46ab63bb74e4fe3aa81521817d94bf70 100644 (file)
@@ -1726,7 +1726,7 @@ ex_retab(exarg_T *eap)
                        len = num_spaces + num_tabs;
                        old_len = (long)STRLEN(ptr);
                        new_len = old_len - col + start_col + len + 1;
-                       if (new_len >= MAXCOL)
+                       if (new_len <= 0 || new_len >= MAXCOL)
                        {
                            emsg(_(e_resulting_text_too_long));
                            break;
index 18f7892f18fc485f5fcd446c63b1e7c1e738f16d..ea5119c32dc6f508ba4b34a21cdd1febfedb5503 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4364,
 /**/
     4363,
 /**/