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-02-18 13:14:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-18 13:14:49 +0300
commit42fd22531f6d53dccdf3f21efb6b6bcc08c1b51b (patch)
tree400bc315b49c67cd16f698be99da5869aafd951e /source/blender/editors
parentcff0110d0882f2cf90a54648bc59366348b5694b (diff)
constraints unique name length was set too long (could overrun the buffer), use sizeof() with other instances of BLI_uniquename too
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/keyframing.c6
-rw-r--r--source/blender/editors/armature/poselib.c4
-rw-r--r--source/blender/editors/space_outliner/outliner.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 58db9cade04..78d579cae4e 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -187,10 +187,10 @@ FCurve *verify_fcurve (bAction *act, const char group[], const char rna_path[],
grp= MEM_callocN(sizeof(bActionGroup), "bActionGroup");
grp->flag = AGRP_SELECTED;
- BLI_snprintf(grp->name, 64, group);
-
+ strncpy(grp->name, group, sizeof(grp->name));
+
BLI_addtail(&act->groups, grp);
- BLI_uniquename(&act->groups, grp, "Group", '.', offsetof(bActionGroup, name), 64);
+ BLI_uniquename(&act->groups, grp, "Group", '.', offsetof(bActionGroup, name), sizeof(grp->name));
}
/* add F-Curve to group */
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index f251fee236b..5cf44951c37 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -373,7 +373,7 @@ static int poselib_add_exec (bContext *C, wmOperator *op)
}
/* validate name */
- BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), 64);
+ BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name));
/* init common-key-source for use by KeyingSets */
memset(&cks, 0, sizeof(bCommonKeySrc));
@@ -578,7 +578,7 @@ static int poselib_rename_exec (bContext *C, wmOperator *op)
/* copy name and validate it */
BLI_strncpy(marker->name, newname, sizeof(marker->name));
- BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), 64);
+ BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name));
/* done */
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index c4db054ff50..795546fdda7 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -4885,7 +4885,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
Object *ob= (Object *)tselem->id; // id = object
bActionGroup *grp= te->directdata;
- BLI_uniquename(&ob->pose->agroups, grp, "Group", '.', offsetof(bActionGroup, name), 32);
+ BLI_uniquename(&ob->pose->agroups, grp, "Group", '.', offsetof(bActionGroup, name), sizeof(grp->name));
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
}
break;