diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-08-10 12:50:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-08-10 12:53:08 +0300 |
commit | 895d3cd11e19b2ec361daad0064155a366359f98 (patch) | |
tree | 7fca00d113993761cbfdad0b33f5fd14269c766b /source/blender/python | |
parent | 182edd4c35c24f809c80674a0dbb9e6a5e3574bc (diff) |
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.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |