[Bf-blender-cvs] [895d3cd11e1] master: Fix T89253: template_list allows arbitrary data changes

Germano Cavalcante noreply at git.blender.org
Tue Aug 10 11:54:44 CEST 2021


Commit: 895d3cd11e19b2ec361daad0064155a366359f98
Author: Germano Cavalcante
Date:   Tue Aug 10 19:50:58 2021 +1000
Branches: master
https://developer.blender.org/rB895d3cd11e19b2ec361daad0064155a366359f98

Fix T89253: template_list allows arbitrary data changes

Blender forbids property changes in .draw() methods. But they weren't
caught after a call to .template_list() with a custom list type.

Support nested calls that disallow writes.

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

M	source/blender/python/intern/bpy_rna.c

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

diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index ec2e70ad262..b83c13e1974 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -8681,6 +8681,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
       }
 
 #ifdef USE_PEDANTIC_WRITE
+      /* Handle nested draw calls, see: T89253. */
+      const bool rna_disallow_writes_prev = rna_disallow_writes;
       rna_disallow_writes = is_readonly ? true : false;
 #endif
       /* *** Main Caller *** */
@@ -8690,7 +8692,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
       /* *** Done Calling *** */
 
 #ifdef USE_PEDANTIC_WRITE
-      rna_disallow_writes = false;
+      rna_disallow_writes = rna_disallow_writes_prev;
 #endif
 
       RNA_parameter_list_end(&iter);



More information about the Bf-blender-cvs mailing list