diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-19 10:59:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-19 10:59:49 +0400 |
commit | 5b920bc2ff1e78767842b13f6997298b7e438204 (patch) | |
tree | 762e490545d634d6f1d3c394f26e392b82a4aa6d /source/blender/editors/sound/sound_ops.c | |
parent | 6a91cf9adb750810d942104cf6ce5fef5a7bf999 (diff) |
Some strings to store ID names were too small, could cause stack corruption.
corrected these and replaced 'sizeof(((ID *)NULL)->name)-2' with 'MAX_ID_NAME-2'.
Diffstat (limited to 'source/blender/editors/sound/sound_ops.c')
-rw-r--r-- | source/blender/editors/sound/sound_ops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 7a5495208bf..3716baad474 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -219,7 +219,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) /* find the suppplied image by name */ if (RNA_property_is_set(op->ptr, "id")) { - char sndname[22]; + char sndname[MAX_ID_NAME-2]; RNA_string_get(op->ptr, "id", sndname); sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2); } @@ -276,7 +276,7 @@ static void SOUND_OT_unpack(wmOperatorType *ot) /* properties */ RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); - RNA_def_string(ot->srna, "id", "", sizeof(((ID *)NULL)->name)-2, "Sound Name", "Sound datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */ + RNA_def_string(ot->srna, "id", "", MAX_ID_NAME-2, "Sound Name", "Sound datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */ } /* ******************************************************* */ |