mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.4245: ":retab 0" may cause illegal memory access
Problem: ":retab 0" may cause illegal memory access. Solution: Limit the value of 'tabstop' to 10000.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user