Patch 9.0.0433
Problem: Coverity warns for not checking allocation failure.
Solution: Check that allocating a list or blob succeeded.
Files: src/eval.c
*** ../vim-9.0.0432/src/eval.c 2022-09-07 17:28:05.849865176 +0100
--- src/eval.c 2022-09-10 10:39:27.040958236 +0100
***************
*** 1121,1126 ****
--- 1121,1128 ----
var2.v_type = VAR_UNKNOWN;
while (*p == '[' || (*p == '.' && p[1] != '=' && p[1] != '.'))
{
+ int r;
+
if (*p == '.' && lp->ll_tv->v_type != VAR_DICT)
{
if (!quiet)
***************
*** 1136,1147 ****
return NULL;
}
! // a NULL list/blob works like an empty list/blob, allocate one now.
if (lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list == NULL)
! rettv_list_alloc(lp->ll_tv);
else if (lp->ll_tv->v_type == VAR_BLOB
&& lp->ll_tv->vval.v_blob == NULL)
! rettv_blob_alloc(lp->ll_tv);
if (lp->ll_range)
{
--- 1138,1151 ----
return NULL;
}
! // A NULL list/blob works like an empty list/blob, allocate one now.
if (lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list == NULL)
! r = rettv_list_alloc(lp->ll_tv);
else if (lp->ll_tv->v_type == VAR_BLOB
&& lp->ll_tv->vval.v_blob == NULL)
! r = rettv_blob_alloc(lp->ll_tv);
! if (r == FAIL)
! return NULL;
if (lp->ll_range)
{
*** ../vim-9.0.0432/src/version.c 2022-09-09 21:35:17.839126931 +0100
--- src/version.c 2022-09-10 10:41:47.536917474 +0100
***************
*** 705,706 ****
--- 705,708 ----
{ /* Add new patch number below this line */
+ /**/
+ 433,
/**/
--
hundred-and-one symptoms of being an internet addict:
37. You start looking for hot HTML addresses in public restrooms.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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/20220910094253.6B5301C0CFD%40moolenaar.net.