diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-15 07:56:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-15 07:56:05 +0400 |
commit | 317b649bb241726d8be1a700cd0028f28914595d (patch) | |
tree | 8fc5953f8da6481ad72e55d247b144ac72eb2638 /source/blender/makesrna | |
parent | f9c41eaaf80fdddb24d5b95cadb51ac859c2d301 (diff) |
fix for buffer overrun with BLI_split_dirfile(...), was simple to do since many places don't check for filename lengyj of 79 chars which is the limit for the file selector.
Add max dir and file length args.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 92739148b99..b90f10693ac 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -443,7 +443,6 @@ static PointerRNA rna_SequenceEditor_meta_stack_get(CollectionPropertyIterator * static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value) { Sequence *seq= (Sequence*)(ptr->data); - char dir[FILE_MAX], name[FILE_MAX]; if(seq->type == SEQ_SOUND && seq->sound) { /* for sound strips we need to update the sound as well. @@ -457,9 +456,7 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value) sound_update_scene_sound(seq->scene_sound, seq->sound); } - BLI_split_dirfile(value, dir, name); - BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir)); - BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name)); + BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name)); } static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value) @@ -481,11 +478,7 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr) static void rna_Sequence_proxy_filepath_set(PointerRNA *ptr, const char *value) { StripProxy *proxy= (StripProxy*)(ptr->data); - char dir[FILE_MAX], name[FILE_MAX]; - - BLI_split_dirfile(value, dir, name); - BLI_strncpy(proxy->dir, dir, sizeof(proxy->dir)); - BLI_strncpy(proxy->file, name, sizeof(proxy->file)); + BLI_split_dirfile(value, proxy->dir, proxy->file, sizeof(proxy->dir), sizeof(proxy->file)); } static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value) @@ -541,20 +534,13 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr) /*static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value) { Sequence *seq= (Sequence*)(ptr->data); - char dir[FILE_MAX], name[FILE_MAX]; - - BLI_split_dirfile(value, dir, name); - BLI_strncpy(seq->strip->dir, dir, sizeof(seq->strip->dir)); - BLI_strncpy(seq->strip->stripdata->name, name, sizeof(seq->strip->stripdata->name)); + BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name)); } static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value) { StripElem *elem= (StripElem*)(ptr->data); - char name[FILE_MAX]; - - BLI_split_dirfile(value, NULL, name); - BLI_strncpy(elem->name, name, sizeof(elem->name)); + BLI_split_dirfile(value, NULL, elem->name, 0, sizeof(elem->name)); }*/ static void rna_Sequence_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) |