[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33410] trunk/blender/source/blender/ makesrna/intern/rna_access.c: fix for crashes trying to resolve paths " location[]" or "location.."

Campbell Barton ideasman42 at gmail.com
Wed Dec 1 10:12:54 CET 2010


Revision: 33410
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33410
Author:   campbellbarton
Date:     2010-12-01 10:12:54 +0100 (Wed, 01 Dec 2010)

Log Message:
-----------
fix for crashes trying to resolve paths "location[]" or "location.."

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_access.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2010-12-01 08:49:08 UTC (rev 33409)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2010-12-01 09:12:54 UTC (rev 33410)
@@ -3085,8 +3085,12 @@
 				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 @@
 				}
 				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);
 				}
 





More information about the Bf-blender-cvs mailing list