[Bf-blender-cvs] [9170e492505] master: Fix missing protection of `RNA_pointer_as_string()` against NULL pointers.
Bastien Montagne
noreply at git.blender.org
Tue Apr 4 16:04:24 CEST 2017
Commit: 9170e4925058eb932988a829c1fb06505447e4cd
Author: Bastien Montagne
Date: Tue Apr 4 15:57:45 2017 +0200
Branches: master
https://developer.blender.org/rB9170e4925058eb932988a829c1fb06505447e4cd
Fix missing protection of `RNA_pointer_as_string()` against NULL pointers.
Odd that issue was never reached before? Looks like it hit in
datablock_idprops branch though...
===================================================================
M source/blender/makesrna/intern/rna_access.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index bb839fd77f8..7266cfb12d6 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5547,6 +5547,9 @@ static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
return BLI_strdup("None");
}
else if (RNA_struct_is_ID(ptr->type)) {
+ if (ptr->id.data == NULL) {
+ return BLI_strdup("None");
+ }
return RNA_path_full_ID_py(ptr->id.data);
}
else {
@@ -5556,7 +5559,10 @@ static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
char *RNA_pointer_as_string(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
{
- if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) {
+ if (ptr_prop->data == NULL) {
+ return BLI_strdup("None");
+ }
+ else if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) {
return RNA_pointer_as_string_id(C, ptr_prop);
}
else {
More information about the Bf-blender-cvs
mailing list