changeset 32792:ba5a67216596 v9.0.1712

patch 9.0.1712: missing null check in object_clear() Commit: https://github.com/vim/vim/commit/5b0889b8bf25b0793b1949ec965c94b623900aba Author: Jia-Ju Bai <baijiaju@buaa.edu.cn> Date: Sun Aug 13 20:04:04 2023 +0200 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>
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Aug 2023 20:15:04 +0200
parents 53c4f1b63c44
children c91d6b0a4d0f
files src/version.c src/vim9class.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1712,
+/**/
     1711,
 /**/
     1710,
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -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)