diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-01-28 20:47:49 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-01-28 20:47:49 +0000 |
commit | 652dee448618589de5528a9e9a36995803f5557a (patch) | |
tree | a659b1d0a7f5409943f2c626e2a87cde520c3733 /src/indent.c | |
parent | 14cbf77845624e4bfc28a65a5debb81864cba2cf (diff) |
patch 8.2.4245: ":retab 0" may cause illegal memory accessv8.2.4245
Problem: ":retab 0" may cause illegal memory access.
Solution: Limit the value of 'tabstop' to 10000.
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c index 8dd4ef99cd..8e9b0d148c 100644 --- a/src/indent.c +++ b/src/indent.c @@ -71,7 +71,7 @@ tabstop_set(char_u *var, int **array) int n = atoi((char *)cp); // Catch negative values, overflow and ridiculous big values. - if (n < 0 || n > 9999) + if (n < 0 || n > TABSTOP_MAX) { semsg(_(e_invalid_argument_str), cp); vim_free(*array); @@ -1649,7 +1649,7 @@ ex_retab(exarg_T *eap) emsg(_(e_argument_must_be_positive)); return; } - if (new_ts < 0 || new_ts > 9999) + if (new_ts < 0 || new_ts > TABSTOP_MAX) { semsg(_(e_invalid_argument_str), eap->arg); return; |