diff options
author | Andrea Weikert <elubie@gmx.net> | 2008-03-30 20:18:01 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2008-03-30 20:18:01 +0400 |
commit | d9de141077873c9379d0bd6ea745b60f5180c4d2 (patch) | |
tree | 36c40794cad938487904814b022f886b9eef9cc9 /source/blender/blenlib/intern/util.c | |
parent | cc4858cde045d17cef5ea9c847484e3168364bd4 (diff) |
== bugfix ==
fix for [#6950] Blender crashes when .blog file top line is 160 characters or more
- made sure BLI_convertstringcode doesn't return more than 240 chars
- went through all callers and fixed places where string passed to BLI_convertstringcode was too short
- TODO: look into increasing sample->name and sound->name too, I prevented crashes, but filename might get shortened.
Diffstat (limited to 'source/blender/blenlib/intern/util.c')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 51691499ba8..6d8dd3d9b50 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1028,8 +1028,8 @@ void BLI_makestringcode(const char *relfile, char *file) int BLI_convertstringcode(char *path, const char *basepath, int framenum) { int len, wasrelative; - char tmp[FILE_MAXDIR+FILE_MAXFILE]; - char base[FILE_MAXDIR]; + char tmp[FILE_MAX]; + char base[FILE_MAX]; char vol[3] = {'\0', '\0', '\0'}; BLI_strncpy(vol, path, 3); @@ -1050,13 +1050,13 @@ int BLI_convertstringcode(char *path, const char *basepath, int framenum) strcat(tmp, p); } else { - strcpy(tmp, path); + BLI_strncpy(tmp, path, FILE_MAX); } #else - strcpy(tmp, path); + BLI_strncpy(tmp, path, FILE_MAX); #endif - strcpy(base, basepath); + BLI_strncpy(base, basepath, FILE_MAX); /* push slashes into unix mode - strings entering this part are potentially messed up: having both back- and forward slashes. |