From 5d1b2d3083f4d013d799a1a2c5fdfe3e28ec48c0 Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Wed, 6 Dec 2023 18:52:19 +0100 Subject: [PATCH] fix(VirtualObject): fix nullptr-dereference in `ZkVirtualObject_setVisual` --- src/vobs/VirtualObject.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vobs/VirtualObject.cc b/src/vobs/VirtualObject.cc index 8712955..d5242ea 100644 --- a/src/vobs/VirtualObject.cc +++ b/src/vobs/VirtualObject.cc @@ -230,8 +230,8 @@ ZkVisual* ZkVirtualObject_setVisual(ZkVirtualObject* slf, ZkVisualType visual) { obj = std::make_shared(); break; case ZkVisualType_UNKNOWN: - obj = nullptr; - break; + slf->visual = nullptr; + return nullptr; } obj->type = static_cast(visual);