forked from aniani/vim
patch 9.1.0688: Vim9: dereferences NULL pointer in check_type_is_value()
Problem: Vim9: dereferences NULL pointer in check_type_is_value() (Suyue Guo) Solution: Verify that the pointer is not Null fixes: #15540 closes: #15545 Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -2138,12 +2138,13 @@ check_type_is_value(type_T *type)
|
||||
switch (type->tt_type)
|
||||
{
|
||||
case VAR_CLASS:
|
||||
if (IS_ENUM(type->tt_class))
|
||||
if (type->tt_class != NULL && IS_ENUM(type->tt_class))
|
||||
semsg(_(e_using_enum_as_value_str),
|
||||
type->tt_class->class_name);
|
||||
else
|
||||
semsg(_(e_using_class_as_value_str),
|
||||
type->tt_class->class_name);
|
||||
type->tt_class == NULL ? (char_u *)""
|
||||
: type->tt_class->class_name);
|
||||
return FAIL;
|
||||
|
||||
case VAR_TYPEALIAS:
|
||||
|
Reference in New Issue
Block a user