[Bf-blender-cvs] [0f6ed7d1112] master: Fix (unreported) potential crash.

Bastien Montagne noreply at git.blender.org
Tue Jan 9 19:52:57 CET 2018


Commit: 0f6ed7d1112dcb1610f419b24651840640f1a68b
Author: Bastien Montagne
Date:   Tue Jan 9 19:51:50 2018 +0100
Branches: master
https://developer.blender.org/rB0f6ed7d1112dcb1610f419b24651840640f1a68b

Fix (unreported) potential crash.

RNA_pointer_as_string could return NULL instead of a valid string in some cases.

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

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 1f974f3a440..b0a77f9b90a 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5745,13 +5745,10 @@ char *RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr)
 
 static char *rna_pointer_as_string__bldata(PointerRNA *ptr)
 {
-	if (ptr->type == NULL) {
+	if (ptr->type == NULL || ptr->id.data == NULL) {
 		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 {



More information about the Bf-blender-cvs mailing list