forked from aniani/vim
patch 8.1.1707: Coverity warns for possibly using a NULL pointer
Problem: Coverity warns for possibly using a NULL pointer. Solution: Change the logic to make sure no NULL pointer is used.
This commit is contained in:
@@ -587,14 +587,13 @@ apply_general_options(win_T *wp, dict_T *dict)
|
|||||||
di = dict_find(dict, (char_u *)"mask", -1);
|
di = dict_find(dict, (char_u *)"mask", -1);
|
||||||
if (di != NULL)
|
if (di != NULL)
|
||||||
{
|
{
|
||||||
int ok = TRUE;
|
int ok = FALSE;
|
||||||
|
|
||||||
if (di->di_tv.v_type != VAR_LIST)
|
if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL)
|
||||||
ok = FALSE;
|
|
||||||
else if (di->di_tv.vval.v_list != NULL)
|
|
||||||
{
|
{
|
||||||
listitem_T *li;
|
listitem_T *li;
|
||||||
|
|
||||||
|
ok = TRUE;
|
||||||
for (li = di->di_tv.vval.v_list->lv_first; li != NULL;
|
for (li = di->di_tv.vval.v_list->lv_first; li != NULL;
|
||||||
li = li->li_next)
|
li = li->li_next)
|
||||||
{
|
{
|
||||||
|
@@ -643,6 +643,10 @@ func Test_popup_invalid_arguments()
|
|||||||
call popup_clear()
|
call popup_clear()
|
||||||
call assert_fails('call popup_create([#{text: "text", props: ["none"]}], {})', 'E715:')
|
call assert_fails('call popup_create([#{text: "text", props: ["none"]}], {})', 'E715:')
|
||||||
call popup_clear()
|
call popup_clear()
|
||||||
|
call assert_fails('call popup_create("text", #{mask: ["asdf"]})', 'E475:')
|
||||||
|
call popup_clear()
|
||||||
|
call assert_fails('call popup_create("text", #{mask: test_null_list()})', 'E475:')
|
||||||
|
call popup_clear()
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_win_execute_closing_curwin()
|
func Test_win_execute_closing_curwin()
|
||||||
|
@@ -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 */
|
||||||
|
/**/
|
||||||
|
1707,
|
||||||
/**/
|
/**/
|
||||||
1706,
|
1706,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user