mirror of
https://github.com/vim/vim.git
synced 2025-10-12 06:44:06 -04:00
patch 8.1.1709: Coverity warns for possibly using a NULL pointer
Problem: Coverity warns for possibly using a NULL pointer. Solution: Make sure no NULL pointer is used.
This commit is contained in:
@@ -516,7 +516,7 @@ apply_general_options(win_T *wp, dict_T *dict)
|
|||||||
di = dict_find(dict, (char_u *)"borderhighlight", -1);
|
di = dict_find(dict, (char_u *)"borderhighlight", -1);
|
||||||
if (di != NULL)
|
if (di != NULL)
|
||||||
{
|
{
|
||||||
if (di->di_tv.v_type != VAR_LIST)
|
if (di->di_tv.v_type != VAR_LIST || di->di_tv.vval.v_list == NULL)
|
||||||
emsg(_(e_listreq));
|
emsg(_(e_listreq));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -524,7 +524,6 @@ apply_general_options(win_T *wp, dict_T *dict)
|
|||||||
listitem_T *li;
|
listitem_T *li;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (list != NULL)
|
|
||||||
for (i = 0, li = list->lv_first; i < 4 && i < list->lv_len;
|
for (i = 0, li = list->lv_first; i < 4 && i < list->lv_len;
|
||||||
++i, li = li->li_next)
|
++i, li = li->li_next)
|
||||||
{
|
{
|
||||||
|
@@ -634,6 +634,8 @@ func Test_popup_invalid_arguments()
|
|||||||
call popup_clear()
|
call popup_clear()
|
||||||
call assert_fails('call popup_create("text", #{borderhighlight: "none"})', 'E714:')
|
call assert_fails('call popup_create("text", #{borderhighlight: "none"})', 'E714:')
|
||||||
call popup_clear()
|
call popup_clear()
|
||||||
|
call assert_fails('call popup_create("text", #{borderhighlight: test_null_list()})', 'E714:')
|
||||||
|
call popup_clear()
|
||||||
call assert_fails('call popup_create("text", #{borderchars: "none"})', 'E714:')
|
call assert_fails('call popup_create("text", #{borderchars: "none"})', 'E714:')
|
||||||
call popup_clear()
|
call popup_clear()
|
||||||
|
|
||||||
|
@@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1709,
|
||||||
/**/
|
/**/
|
||||||
1708,
|
1708,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user