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:
authorCampbell Barton <ideasman42@gmail.com>2010-12-01 12:12:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-01 12:12:54 +0300
commit2ada145fa46d9a91bd72e5a8884578bc5b8e8263 (patch)
treea8fd9e627267cd0c7be8b7113741bd0e5c43a9b0 /source/blender/makesrna/intern/rna_access.c
parentfd7728883a63820674332b04bc9000f1acb380f8 (diff)
fix for crashes trying to resolve paths "location[]" or "location.."
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index db8710aec2a..d8c4c67c68a 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -3085,8 +3085,12 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
if (*path=='[') {
token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1);
+ if(token==NULL) {
+ /* invalid syntax blah[] */
+ return 0;
+ }
/* check for "" to see if it is a string */
- if(rna_token_strip_quotes(token)) {
+ else if(rna_token_strip_quotes(token)) {
*index= RNA_property_array_item_index(prop, *(token+1));
}
else {
@@ -3096,6 +3100,10 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr,
}
else {
token= rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0);
+ if(token==NULL) {
+ /* invalid syntax blah.. */
+ return 0;
+ }
*index= RNA_property_array_item_index(prop, *token);
}