To: vim_dev@googlegroups.com Subject: Patch 8.2.3589 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: runtime/doc/terminal.txt, src/job.c, src/testdir/test_terminal.vim *** ../vim-8.2.3588/runtime/doc/terminal.txt 2021-10-15 22:25:37.785385044 +0100 --- runtime/doc/terminal.txt 2021-11-13 09:45:26.219789809 +0000 *************** *** 850,856 **** "term_name" name to use for the buffer name, instead of the command name. "term_rows" vertical size to use for the terminal, ! instead of using 'termwinsize' "term_cols" horizontal size to use for the terminal, instead of using 'termwinsize' "vertical" split the window vertically; note that --- 871,878 ---- "term_name" name to use for the buffer name, instead of the command name. "term_rows" vertical size to use for the terminal, ! instead of using 'termwinsize'; valid ! range is from zero to 1000 "term_cols" horizontal size to use for the terminal, instead of using 'termwinsize' "vertical" split the window vertically; note that *** ../vim-8.2.3588/src/job.c 2021-11-12 16:01:11.944325433 +0000 --- src/job.c 2021-11-13 10:24:10.551773997 +0000 *************** *** 432,437 **** --- 432,442 ---- 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) { *** ../vim-8.2.3588/src/testdir/test_terminal.vim 2021-11-12 16:01:11.948325522 +0000 --- src/testdir/test_terminal.vim 2021-11-13 10:26:02.895787242 +0000 *************** *** 467,472 **** --- 467,474 ---- 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 *** ../vim-8.2.3588/src/version.c 2021-11-12 19:52:44.512731547 +0000 --- src/version.c 2021-11-13 10:26:42.247780660 +0000 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 3589, /**/ -- Futility Factor: No experiment is ever a complete failure - it can always serve as a negative example. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///