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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211113102825.86C081C5232%40moolenaar.net.

Raspunde prin e-mail lui