summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-05 11:13:05 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-05 11:13:05 +0000
commitfc88df42f1ae64bcc4d6cbc0fbd3445f8c59afdf (patch)
tree72d864d9ae9b5c2ea1fcae50e9c0fb7b3859263b /src/indent.c
parent21ebb0899ecf9049c3e1c9cbc2e06fd8e2a99e06 (diff)
downloadvim-git-fc88df42f1ae64bcc4d6cbc0fbd3445f8c59afdf.tar.gz
patch 8.2.4298: divide by zero with huge tabstop valuev8.2.4298
Problem: Divide by zero with huge tabstop value. Solution: Reject tabstop value that overflows to zero.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c
index b62308d2a..9b137b0b4 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 > TABSTOP_MAX)
+ if (n <= 0 || n > TABSTOP_MAX)
{
semsg(_(e_invalid_argument_str), cp);
vim_free(*array);