1
0
forked from aniani/vim

patch 8.2.4034: Coverity warns for possibly using a NULL pointer

Problem:    Coverity warns for possibly using a NULL pointer.
Solution:   Check v_partial is not NULL.
This commit is contained in:
Bram Moolenaar
2022-01-07 20:18:16 +00:00
parent a4c96252b1
commit 62a099cc6d
2 changed files with 3 additions and 1 deletions

View File

@@ -750,6 +750,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 */
/**/
4034,
/**/ /**/
4033, 4033,
/**/ /**/

View File

@@ -375,7 +375,7 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int flags)
set_function_type(ufunc); set_function_type(ufunc);
if (ufunc->uf_func_type != NULL) if (ufunc->uf_func_type != NULL)
{ {
if (tv->v_type == VAR_PARTIAL if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL
&& tv->vval.v_partial->pt_argc > 0) && tv->vval.v_partial->pt_argc > 0)
{ {
type = get_type_ptr(type_gap); type = get_type_ptr(type_gap);