diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-02-12 15:42:18 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-12 15:42:18 +0000 |
commit | 6e28703a8e41f775f64e442c5d11ce1ff599aa3f (patch) | |
tree | 611b797e8448336aaf4be95c58aec341a948632c /src/indent.c | |
parent | 90a57168a42048eb7e176a4f9acf607c31e8074f (diff) |
patch 8.2.4359: crash when repeatedly using :retabv8.2.4359
Problem: crash when repeatedly using :retab.
Solution: Bail out when the line is getting too long.
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c index 9b137b0b42..232c534973 100644 --- 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 |