diff src/indent.c @ 27667:289e87a78307 v8.2.4359

patch 8.2.4359: crash when repeatedly using :retab Commit: https://github.com/vim/vim/commit/6e28703a8e41f775f64e442c5d11ce1ff599aa3f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 12 15:42:18 2022 +0000 patch 8.2.4359: crash when repeatedly using :retab Problem: crash when repeatedly using :retab. Solution: Bail out when the line is getting too long.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Feb 2022 16:45:03 +0100
parents 8e8fb566dfa5
children ba7dcf54d309
line wrap: on
line diff
--- a/src/indent.c
+++ b/src/indent.c
@@ -1750,6 +1750,11 @@ ex_retab(exarg_T *eap)
 	    if (ptr[col] == NUL)
 		break;
 	    vcol += chartabsize(ptr + col, (colnr_T)vcol);
+	    if (vcol >= MAXCOL)
+	    {
+		emsg(_(e_resulting_text_too_long));
+		break;
+	    }
 	    if (has_mbyte)
 		col += (*mb_ptr2len)(ptr + col);
 	    else