0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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.
This commit is contained in:
Bram Moolenaar
2022-02-12 15:42:18 +00:00
parent 90a57168a4
commit 6e28703a8e
3 changed files with 26 additions and 0 deletions

View File

@@ -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