From 2ada145fa46d9a91bd72e5a8884578bc5b8e8263 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Dec 2010 09:12:54 +0000 Subject: fix for crashes trying to resolve paths "location[]" or "location.." --- source/blender/makesrna/intern/rna_access.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to '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 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); } -- cgit v1.2.3