Skip to content

Commit

Permalink
patch 9.0.1712: missing null check in object_clear()
Browse files Browse the repository at this point in the history
Problem: missing null check in object_clear()
Solution: Add null check of cl

closes: #12627

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Jia-Ju Bai <baijiaju@buaa.edu.cn>
  • Loading branch information
Jia-Ju Bai authored and chrisbra committed Aug 13, 2023
1 parent d3515a1 commit 5b0889b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1712,
/**/
1711,
/**/
Expand Down
3 changes: 3 additions & 0 deletions src/vim9class.c
Expand Up @@ -1509,6 +1509,9 @@ object_clear(object_T *obj)

class_T *cl = obj->obj_class;

if (!cl)
return;

// the member values are just after the object structure
typval_T *tv = (typval_T *)(obj + 1);
for (int i = 0; i < cl->class_obj_member_count; ++i)
Expand Down

0 comments on commit 5b0889b

Please sign in to comment.