Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-15 07:56:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-15 07:56:05 +0400
commit317b649bb241726d8be1a700cd0028f28914595d (patch)
tree8fc5953f8da6481ad72e55d247b144ac72eb2638 /source/blender/editors/space_file/filesel.c
parentf9c41eaaf80fdddb24d5b95cadb51ac859c2d301 (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/editors/space_file/filesel.c')
-rw-r--r--source/blender/editors/space_file/filesel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 6cc42b2a751..f36145aaba0 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -113,7 +113,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
if (!sfile->params) {
sfile->params= MEM_callocN(sizeof(FileSelectParams), "fileselparams");
/* set path to most recently opened .blend */
- BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
sfile->params->filter_glob[0] = '\0';
}
@@ -142,7 +142,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
sfile->params->file[0]= '\0';
}
else {
- BLI_split_dirfile(name, sfile->params->dir, sfile->params->file);
+ BLI_split_dirfile(name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file));
}
}
else {
@@ -613,7 +613,7 @@ void autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
DIR *dir;
struct dirent *de;
- BLI_split_dirfile(str, dirname, NULL);
+ BLI_split_dirfile(str, dirname, NULL, sizeof(dirname), 0);
dir = opendir(dirname);