]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1712: missing null check in object_clear() 12757/head v9.0.1712
authorJia-Ju Bai <baijiaju@buaa.edu.cn>
Sun, 13 Aug 2023 18:04:04 +0000 (20:04 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 13 Aug 2023 18:05:18 +0000 (20:05 +0200)
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>
src/version.c
src/vim9class.c

index 3a7d4bb4db99a8fed4b4b0db1641a65cb83d7789..45f5527d190d9e52083d888b6d64e5f31199d9e4 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1712,
 /**/
     1711,
 /**/
index 2f2422871a59da5b87f26a5d32dac7d85f89cdfd..562db25b5d59c2b24ca2f18121ab18e0e92a6b1c 100644 (file)
@@ -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)