commit | 6e28703a8e41f775f64e442c5d11ce1ff599aa3f | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sat Feb 12 15:42:18 2022 +0000 |
committer | Bram Moolenaar <Bram@vim.org> | Sat Feb 12 15:42:18 2022 +0000 |
tree | 611b797e8448336aaf4be95c58aec341a948632c | |
parent | 90a57168a42048eb7e176a4f9acf607c31e8074f [diff] [blame] |
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.
diff --git a/src/indent.c b/src/indent.c index 9b137b0..232c534 100644 --- a/src/indent.c +++ b/src/indent.c
@@ -1750,6 +1750,11 @@ 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