0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.1712: missing null check in object_clear()

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>
This commit is contained in:
Jia-Ju Bai
2023-08-13 20:04:04 +02:00
committed by Christian Brabandt
parent d3515a1e88
commit 5b0889b8bf
2 changed files with 5 additions and 0 deletions

View File

@@ -695,6 +695,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 */
/**/
1712,
/**/ /**/
1711, 1711,
/**/ /**/

View File

@@ -1509,6 +1509,9 @@ object_clear(object_T *obj)
class_T *cl = obj->obj_class; class_T *cl = obj->obj_class;
if (!cl)
return;
// the member values are just after the object structure // the member values are just after the object structure
typval_T *tv = (typval_T *)(obj + 1); typval_T *tv = (typval_T *)(obj + 1);
for (int i = 0; i < cl->class_obj_member_count; ++i) for (int i = 0; i < cl->class_obj_member_count; ++i)