patch 9.0.1712: missing null check in object_clear()
Commit:
https://github.com/vim/vim/commit/5b0889b8bf25b0793b1949ec965c94b623900aba
Author: Jia-Ju Bai <[email protected]>
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 <[email protected]>
Co-authored-by: Jia-Ju Bai <[email protected]>
diff --git a/src/version.c b/src/version.c
index 3a7d4bb4d..45f5527d1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1712,
/**/
1711,
/**/
diff --git a/src/vim9class.c b/src/vim9class.c
index 2f2422871..562db25b5 100644
--- 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)
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1qVFcG-000NOd-MT%40256bit.org.