Skip to content

Commit f908f19

Browse files
timothyqiuSpartan322
authored andcommitted
Fix heap-use-after-free when ctrl-clicking controls in a container
(cherry picked from commit 574b413)
1 parent eccbd1f commit f908f19

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

editor/plugins/canvas_item_editor_plugin.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,10 +1462,12 @@ bool CanvasItemEditor::_gui_input_rotate(const Ref<InputEvent> &p_event) {
14621462
List<CanvasItem *> selection = _get_edited_canvas_items(false, true, &has_locked_items);
14631463

14641464
// Remove not movable nodes
1465-
for (CanvasItem *E : selection) {
1466-
if (!_is_node_movable(E, true)) {
1465+
for (List<CanvasItem *>::Element *E = selection.front(); E;) {
1466+
List<CanvasItem *>::Element *N = E->next();
1467+
if (!_is_node_movable(E->get(), true)) {
14671468
selection.erase(E);
14681469
}
1470+
E = N;
14691471
}
14701472

14711473
drag_selection = selection;

0 commit comments

Comments
 (0)