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 -- [email protected] -- 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 ///
--
--
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/201907171928.x6HJS6la017693%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.