commit | fc88df42f1ae64bcc4d6cbc0fbd3445f8c59afdf | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sat Feb 05 11:13:05 2022 +0000 |
committer | Bram Moolenaar <Bram@vim.org> | Sat Feb 05 11:13:05 2022 +0000 |
tree | 72d864d9ae9b5c2ea1fcae50e9c0fb7b3859263b | |
parent | 21ebb0899ecf9049c3e1c9cbc2e06fd8e2a99e06 [diff] [blame] |
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.
diff --git a/src/indent.c b/src/indent.c index b62308d..9b137b0 100644 --- a/src/indent.c +++ b/src/indent.c
@@ -71,7 +71,7 @@ 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);