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/collada
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/collada')
-rw-r--r--source/blender/collada/DocumentImporter.cpp2
-rw-r--r--source/blender/collada/ImageExporter.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index e98f551a097..056d74aabfb 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -884,7 +884,7 @@ bool DocumentImporter::writeImage( const COLLADAFW::Image* image )
char dir[FILE_MAX];
char full_path[FILE_MAX];
- BLI_split_dirfile(filename, dir, NULL);
+ BLI_split_dirfile(filename, dir, NULL, sizeof(dir), 0);
BLI_join_dirfile(full_path, sizeof(full_path), dir, filepath.c_str());
Image *ima = BKE_add_image_file(full_path);
if (!ima) {
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp
index 747f3c783d7..53c43677c18 100644
--- a/source/blender/collada/ImageExporter.cpp
+++ b/source/blender/collada/ImageExporter.cpp
@@ -97,7 +97,7 @@ void ImagesExporter::operator()(Material *ma, Object *ob)
char src[FILE_MAX];
char dir[FILE_MAX];
- BLI_split_dirfile(this->export_settings->filepath, dir, NULL);
+ BLI_split_dirfile(this->export_settings->filepath, dir, NULL, sizeof(dir), 0);
BKE_rebase_path(abs, sizeof(abs), rel, sizeof(rel), G.main->name, image->name, dir);