Patch 8.1.1707

11 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 17, 2019, 3:28:15 PM7/17/19
to vim...@googlegroups.com

Patch 8.1.1707
Problem: Coverity warns for possibly using a NULL pointer.
Solution: Change the logic to make sure no NULL pointer is used.
Files: src/popupwin.c, src/testdir/test_popupwin.vim


*** ../vim-8.1.1706/src/popupwin.c 2019-07-14 16:27:47.917121312 +0200
--- src/popupwin.c 2019-07-17 21:25:02.787725706 +0200
***************
*** 587,600 ****
di = dict_find(dict, (char_u *)"mask", -1);
if (di != NULL)
{
! int ok = TRUE;

! if (di->di_tv.v_type != VAR_LIST)
! ok = FALSE;
! else if (di->di_tv.vval.v_list != NULL)
{
listitem_T *li;

for (li = di->di_tv.vval.v_list->lv_first; li != NULL;
li = li->li_next)
{
--- 587,599 ----
di = dict_find(dict, (char_u *)"mask", -1);
if (di != NULL)
{
! int ok = FALSE;

! if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL)
{
listitem_T *li;

+ ok = TRUE;
for (li = di->di_tv.vval.v_list->lv_first; li != NULL;
li = li->li_next)
{
*** ../vim-8.1.1706/src/testdir/test_popupwin.vim 2019-07-16 22:03:28.906863140 +0200
--- src/testdir/test_popupwin.vim 2019-07-17 21:26:42.631231365 +0200
***************
*** 643,648 ****
--- 643,652 ----
call popup_clear()
call assert_fails('call popup_create([#{text: "text", props: ["none"]}], {})', 'E715:')
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

func Test_win_execute_closing_curwin()
*** ../vim-8.1.1706/src/version.c 2019-07-17 20:01:43.053603881 +0200
--- src/version.c 2019-07-17 21:22:04.744607709 +0200
***************
*** 779,780 ****
--- 779,782 ----
{ /* Add new patch number below this line */
+ /**/
+ 1707,
/**/

--
The Law, in its majestic equality, forbids the rich, as well as the
poor, to sleep under the bridges, to beg in the streets, and to steal
bread. -- Anatole France

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages