To: vim_dev@googlegroups.com Subject: Patch 9.0.0433 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///