fix for possible uninitialized RNA strings, when RNA_string_get property is not found...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 5 Aug 2011 06:09:30 +0000 (06:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 5 Aug 2011 06:09:30 +0000 (06:09 +0000)
source/blender/makesrna/intern/rna_access.c
source/blender/windowmanager/intern/wm_operators.c

index e71be8c153e89fbc9366c9d337133ceb74789005..f1056c86a4cb1d0c9380bccdb1a5b3f405497611 100644 (file)
@@ -4007,10 +4007,13 @@ void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
 {
        PropertyRNA *prop= RNA_struct_find_property(ptr, name);
 
-       if(prop)
+       if(prop) {
                RNA_property_string_get(ptr, prop, value);
-       else
+       }
+       else {
                printf("RNA_string_get: %s.%s not found.\n", ptr->type->identifier, name);
+               value[0]= '\0';
+       }
 }
 
 char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen)
index 5a05be0fefc0a19c56cc2ce31eb0e1b151aa3bad..7238cede2ccdbcb22e346649aa0c75f61ade9605 100644 (file)
@@ -1621,7 +1621,6 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
        int idcode, totfiles=0;
        short flag;
 
-       name[0] = '\0';
        RNA_string_get(op->ptr, "filename", name);
        RNA_string_get(op->ptr, "directory", dir);