diff options
author | Julian Eisel <julian@blender.org> | 2021-10-06 12:20:15 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-06 12:24:24 +0300 |
commit | b5ea3d2c09c5df49ed783dabdc83820c55effdd2 (patch) | |
tree | 3421f5d6ef96c15a2788e6be4118aad2574ba321 /source/blender/editors/interface/interface.c | |
parent | ca0450feeffdb07eea11c17aa617bfd7b9a04913 (diff) |
Fix possible use-after-free when cancelling temporary rename button
If a renaming button was removed via `UI_but_active_only_ex()` and that
button was placed using the layout system, the button was still in the
layout.
So far this didn't cause issues, because all cases where the button may
be removed were not using the layout system.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9a294162f34..88b23e07f54 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1014,6 +1014,9 @@ bool UI_but_active_only_ex( else if ((found == true) && (isactive == false)) { if (remove_on_failure) { BLI_remlink(&block->buttons, but); + if (but->layout) { + ui_layout_remove_but(but->layout, but); + } ui_but_free(C, but); } return false; |