[Bf-blender-cvs] [163d99b] blender-v2.74-release: Fix crash using removed data as function arguments
Campbell Barton
noreply at git.blender.org
Tue Mar 24 15:59:23 CET 2015
Commit: 163d99b7a9ff20010b106ae7ea027cb363a15552
Author: Campbell Barton
Date: Wed Mar 18 15:50:29 2015 +1100
Branches: blender-v2.74-release
https://developer.blender.org/rB163d99b7a9ff20010b106ae7ea027cb363a15552
Fix crash using removed data as function arguments
===================================================================
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 fadc50e..2aab7e0 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -1830,25 +1830,23 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
RNA_property_pointer_set(ptr, prop, param->ptr);
}
else {
+ raise_error = true;
+ }
+ }
+
+ if (raise_error) {
+ if (pyrna_struct_validity_check(param) == -1) {
+ /* error set */
+ }
+ else {
PointerRNA tmp;
RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a %.200s type. not %.200s",
+ "%.200s %.200s.%.200s expected a %.200s type, not %.200s",
error_prefix, RNA_struct_identifier(ptr->type),
RNA_property_identifier(prop), RNA_struct_identifier(tmp.type),
RNA_struct_identifier(param->ptr.type));
- Py_XDECREF(value_new); return -1;
}
- }
-
- if (raise_error) {
- PointerRNA tmp;
- RNA_pointer_create(NULL, ptr_type, NULL, &tmp);
- PyErr_Format(PyExc_TypeError,
- "%.200s %.200s.%.200s expected a %.200s type, not %.200s",
- error_prefix, RNA_struct_identifier(ptr->type),
- RNA_property_identifier(prop), RNA_struct_identifier(tmp.type),
- RNA_struct_identifier(param->ptr.type));
Py_XDECREF(value_new); return -1;
}
}
More information about the Bf-blender-cvs
mailing list