Skip to content

Commit 6756c70

Browse files
committed
patch 8.0.1061: Coverity: no check for NULL command
Problem: Coverity: no check for NULL command. Solution: Check for NULL list item.
1 parent 3971905 commit 6756c70

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/terminal.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
* in tl_scrollback are no longer used.
3939
*
4040
* TODO:
41-
* - ":term NONE" does not work in MS-Windows.
41+
* - ":term NONE" does not work on MS-Windows.
42+
* https://github.com/vim/vim/pull/2056
43+
* - Redirecting output does not work on MS-Windows.
4244
* - implement term_setsize()
4345
* - add test for giving error for invalid 'termsize' value.
4446
* - support minimal size when 'termsize' is "rows*cols".
@@ -56,6 +58,8 @@
5658
* - In the GUI use a terminal emulator for :!cmd.
5759
* - Copy text in the vterm to the Vim buffer once in a while, so that
5860
* completion works.
61+
* - add an optional limit for the scrollback size. When reaching it remove
62+
* 10% at the start.
5963
*/
6064

6165
#include "vim.h"
@@ -366,10 +370,10 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
366370
}
367371
else if (argvar->v_type != VAR_LIST
368372
|| argvar->vval.v_list == NULL
369-
|| argvar->vval.v_list->lv_len < 1)
373+
|| argvar->vval.v_list->lv_len < 1
374+
|| (cmd = get_tv_string_chk(
375+
&argvar->vval.v_list->lv_first->li_tv)) == NULL)
370376
cmd = (char_u*)"";
371-
else
372-
cmd = get_tv_string_chk(&argvar->vval.v_list->lv_first->li_tv);
373377

374378
len = STRLEN(cmd) + 10;
375379
p = alloc((int)len);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1061,
772774
/**/
773775
1060,
774776
/**/

0 commit comments

Comments
 (0)