diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-13 10:27:40 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-13 10:27:40 +0000 |
commit | 5300be620c77950caa5296019408ee02e60097e8 (patch) | |
tree | dee544e252d0f476bcafbc2b5e05b886e4592aa7 /src | |
parent | 606efc7df4c94104bbd24248106dd0e4ee6f7cfa (diff) | |
download | vim-git-8.2.3589.tar.gz |
patch 8.2.3589: failure when "term_rows" of term_start() is an unusual valuev8.2.3589
Problem: Failure when the "term_rows" argument of term_start() is an
unusual value.
Solution: Limit to range of zero to 1000. (closes #9116)
Diffstat (limited to 'src')
-rw-r--r-- | src/job.c | 5 | ||||
-rw-r--r-- | src/testdir/test_terminal.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 9 insertions, 0 deletions
@@ -432,6 +432,11 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_term_rows = tv_get_number_chk(item, &error); if (error) return FAIL; + if (opt->jo_term_rows < 0 || opt->jo_term_rows > 1000) + { + semsg(_(e_invargval), "term_rows"); + return FAIL; + } } else if (STRCMP(hi->hi_key, "term_cols") == 0) { diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 3e263efd2..cd7f477c2 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -467,6 +467,8 @@ func Test_terminal_size() bwipe! call assert_equal([7, 27], size) + call assert_fails("call term_start(cmd, {'term_rows': -1})", 'E475:') + call assert_fails("call term_start(cmd, {'term_rows': 1001})", 'E475:') if has('float') call assert_fails("call term_start(cmd, {'term_rows': 10.0})", 'E805:') endif diff --git a/src/version.c b/src/version.c index 4be3fd2f5..8e2a10b27 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3589, +/**/ 3588, /**/ 3587, |