[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42810] trunk/blender/source/blender/ blenkernel/intern/ipo.c: fix for use of uninitialized value for ipo conversion.

Campbell Barton ideasman42 at gmail.com
Wed Dec 21 22:40:22 CET 2011


Revision: 42810
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42810
Author:   campbellbarton
Date:     2011-12-21 21:40:21 +0000 (Wed, 21 Dec 2011)
Log Message:
-----------
fix for use of uninitialized value for ipo conversion.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/ipo.c

Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c	2011-12-21 21:21:27 UTC (rev 42809)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c	2011-12-21 21:40:21 UTC (rev 42810)
@@ -909,8 +909,10 @@
 		if (array_index)
 			*array_index= dummy_index;
 	}
-	
+
+	/* 'buf' _must_ be initialized in this block */
 	/* append preceding bits to path */
+	/* note, strings are not escapted and they should be! */
 	if ((actname && actname[0]) && (constname && constname[0])) {
 		/* Constraint in Pose-Channel */
 		sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
@@ -918,6 +920,7 @@
 	else if (actname && actname[0]) {
 		if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) {
 			/* Actionified "Object" IPO's... no extra path stuff needed */
+			buf[0]= '\0'; /* empty string */
 		}
 		else if ((blocktype == ID_KE) && strcmp(actname, "Shape")==0) {
 			/* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */
@@ -936,8 +939,10 @@
 		/* Sequence names in Scene */
 		sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2);
 	}
-	else
+	else {
 		buf[0]= '\0'; /* empty string */
+	}
+
 	BLI_dynstr_append(path, buf);
 	
 	/* need to add dot before property if there was anything precceding this */




More information about the Bf-blender-cvs mailing list