[Bf-blender-cvs] [9e8a488af20] blender-v2.91-release: Fix T81691: Use-after-free with property search and hovered button

Hans Goudey noreply at git.blender.org
Tue Nov 3 23:31:05 CET 2020


Commit: 9e8a488af2093c2724af9372aebb96f5e6736a65
Author: Hans Goudey
Date:   Tue Nov 3 16:30:58 2020 -0600
Branches: blender-v2.91-release
https://developer.blender.org/rB9e8a488af2093c2724af9372aebb96f5e6736a65

Fix T81691: Use-after-free with property search and hovered button

The list of buttons in the button group needs to be updated to take into
account the old button inserted into the button list for the new block.

Differential Revision: https://developer.blender.org/D9428

===================================================================

M	source/blender/editors/interface/interface.c

===================================================================

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 601ab44c3d6..dc20e6f1813 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -832,6 +832,8 @@ static bool ui_but_update_from_old_block(const bContext *C,
     /* move button over from oldblock to new block */
     BLI_remlink(&oldblock->buttons, oldbut);
     BLI_insertlinkafter(&block->buttons, but, oldbut);
+    /* Add the old button to the button groups in the new block. */
+    ui_button_group_replace_but_ptr(block, but, oldbut);
     oldbut->block = block;
     *but_p = oldbut;



More information about the Bf-blender-cvs mailing list