mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user