vim-patch:8.2.4298: divide by zero with huge tabstop value

Problem:    Divide by zero with huge tabstop value.
Solution:   Reject tabstop value that overflows to zero.
fc88df42f1
This commit is contained in:
zeertzjq
2022-02-05 20:03:02 +08:00
parent 806a7c976d
commit e6cfd20b7f
2 changed files with 11 additions and 1 deletions

View File

@@ -7551,7 +7551,7 @@ bool tabstop_set(char_u *var, long **array)
int n = atoi((char *)cp);
// Catch negative values, overflow and ridiculous big values.
if (n < 0 || n > TABSTOP_MAX) {
if (n <= 0 || n > TABSTOP_MAX) {
semsg(_(e_invarg2), cp);
XFREE_CLEAR(*array);
return false;