# HG changeset patch # User Christian Brabandt # Date 1691950504 -7200 # Node ID ba5a672165969a0c4a9eb1e90260e145d142115b # Parent 53c4f1b63c449651d682a9e25fc84d0ebe6c73f9 patch 9.0.1712: missing null check in object_clear() Commit: https://github.com/vim/vim/commit/5b0889b8bf25b0793b1949ec965c94b623900aba Author: Jia-Ju Bai 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 Co-authored-by: Jia-Ju Bai diff --git a/src/version.c b/src/version.c --- 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, diff --git a/src/vim9class.c b/src/vim9class.c --- 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)