diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-05 10:09:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-05 10:09:30 +0400 |
commit | c946969bb90c177319c183e7155c6f360230ea2f (patch) | |
tree | 9ee13da640900d19ce003314fdd306f18031dcd1 /source/blender | |
parent | 82e863bdae70b1297318aa7fd98f72cab074ef66 (diff) |
fix for possible uninitialized RNA strings, when RNA_string_get property is not found, initialize the string to "".
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index e71be8c153e..f1056c86a4c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -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) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 5a05be0fefc..7238cede2cc 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -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); |