Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2017-04-04 16:57:45 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-04-04 17:04:13 +0300
commit9170e4925058eb932988a829c1fb06505447e4cd (patch)
tree9f529697e9ff3e7703593529aa1d78da534e9b78 /source/blender/makesrna
parent92aeb84fde6402c0d2e337b030c06cfd171f5ba1 (diff)
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...
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_access.c8
1 files changed, 7 insertions, 1 deletions
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 {