diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
commit | 867fc4b463ef39ea16103f18f332c3d259624d29 (patch) | |
tree | 7d20c416241afb7b878b767a9955e284d3cddbe2 /source/blender/makesrna | |
parent | 9e03a0d4762b4734fe7ccb20e03b4a3c8f939620 (diff) |
enforce string limits (reported by pedantic checking tools & some developers).
mostly replace strcpy with BLI_strncpy and multiple strcat's with a BLI_snprintf().
also fix possible crash if CWD isnt available.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 233ffd06188..d3d36bff012 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -446,7 +446,7 @@ static void rna_Sequence_filepath_get(PointerRNA *ptr, char *value) Sequence *seq= (Sequence*)(ptr->data); char path[FILE_MAX]; - BLI_join_dirfile(path, seq->strip->dir, seq->strip->stripdata->name); + BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name); BLI_strncpy(value, path, strlen(path)+1); } @@ -455,7 +455,7 @@ static int rna_Sequence_filepath_length(PointerRNA *ptr) Sequence *seq= (Sequence*)(ptr->data); char path[FILE_MAX]; - BLI_join_dirfile(path, seq->strip->dir, seq->strip->stripdata->name); + BLI_join_dirfile(path, sizeof(path), seq->strip->dir, seq->strip->stripdata->name); return strlen(path)+1; } @@ -474,7 +474,7 @@ static void rna_Sequence_proxy_filepath_get(PointerRNA *ptr, char *value) StripProxy *proxy= (StripProxy*)(ptr->data); char path[FILE_MAX]; - BLI_join_dirfile(path, proxy->dir, proxy->file); + BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file); BLI_strncpy(value, path, strlen(path)+1); } @@ -483,7 +483,7 @@ static int rna_Sequence_proxy_filepath_length(PointerRNA *ptr) StripProxy *proxy= (StripProxy*)(ptr->data); char path[FILE_MAX]; - BLI_join_dirfile(path, proxy->dir, proxy->file); + BLI_join_dirfile(path, sizeof(path), proxy->dir, proxy->file); return strlen(path)+1; } diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index e080b735048..b2b38bc38be 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -255,7 +255,7 @@ static void rna_userdef_addon_remove(bAddon *bext) static void rna_userdef_temp_update(Main *bmain, Scene *scene, PointerRNA *ptr) { extern char btempdir[]; - BLI_where_is_temp(btempdir, 1); + BLI_where_is_temp(btempdir, FILE_MAX, 1); } static void rna_userdef_text_update(Main *bmain, Scene *scene, PointerRNA *ptr) |