diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-02-09 21:27:20 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-02-09 21:27:20 +0300 |
commit | c7c0e7bf808dbbe93bb3d659eb1c27bcc496fadc (patch) | |
tree | 8ef372336c3de476c43edc01f31087a17e490e8e | |
parent | a6cbfb617fb85e2909b033bae85fed94bd82d5cb (diff) |
==== bugfix ====
- fix for #5955
- fixing too short pathnames causing memory overwriting when
starting blender from a path with a very long name.
-rw-r--r-- | source/blender/python/BPY_interface.c | 6 | ||||
-rw-r--r-- | source/blender/python/BPY_menus.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index ce9fb81eebe..e3eb5b25c26 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -332,11 +332,11 @@ that dir info is available. ****************************************************************************/ void BPY_post_start_python( void ) { - char dirpath[FILE_MAXDIR]; + char dirpath[FILE_MAX]; char *sdir = NULL; if(U.pythondir[0] != '\0' ) { - char modpath[FILE_MAXDIR]; + char modpath[FILE_MAX]; int upyslen = strlen(U.pythondir); /* check if user pydir ends with a slash and, if so, remove the slash @@ -349,7 +349,7 @@ void BPY_post_start_python( void ) U.pythondir[upyslen - 1] = '\0'; } - BLI_strncpy(dirpath, U.pythondir, FILE_MAXDIR); + BLI_strncpy(dirpath, U.pythondir, FILE_MAX); BLI_convertstringcode(dirpath, G.sce, 0); syspath_append(dirpath); /* append to module search path */ diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c index bee674c2b7a..2a53ba1adf1 100644 --- a/source/blender/python/BPY_menus.c +++ b/source/blender/python/BPY_menus.c @@ -823,8 +823,8 @@ static int bpymenu_ParseDir(char *dirname, char *parentdir, int is_userdir ) struct dirent *de; struct stat status; char *file_extension; - char path[FILE_MAXDIR]; - char subdir[FILE_MAXDIR]; + char path[FILE_MAX]; + char subdir[FILE_MAX]; char *s = NULL; dir = opendir(dirname); |