From 601915244264ed265c1ca1808a6bb2842cab2286 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 9 Aug 2024 09:45:06 +0200 Subject: editor: fix use after free --- editor/vobj-editor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'editor/vobj-editor.cpp') diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp index 6dc8c907..c95af843 100644 --- a/editor/vobj-editor.cpp +++ b/editor/vobj-editor.cpp @@ -48,8 +48,9 @@ void vobj_editor::place_tile(world& w, global_coords pos, const vobj_* x, struct if (!x) { auto [c, t] = w[pos]; +start: const auto& es = c.objects(); -start: while (auto id = a.get_object_colliding_with_cursor()) + while (auto id = a.get_object_colliding_with_cursor()) { for (auto i = (int)(es.size()-1); i >= 0; i--) { -- cgit v1.2.3