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/blenlib/intern/winstuff.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/blenlib/intern/winstuff.c')
-rw-r--r--source/blender/blenlib/intern/winstuff.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index 3b14abb0bee..9594197ef90 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -53,11 +53,10 @@
int BLI_getInstallationDir( char * str ) {
char dir[FILE_MAXDIR];
- char file[FILE_MAXFILE];
int a;
GetModuleFileName(NULL,str,FILE_MAXDIR+FILE_MAXFILE);
- BLI_split_dirfile(str,dir,file); /* shouldn't be relative */
+ BLI_split_dirfile(str, dir, NULL, sizeof(dir), 0); /* shouldn't be relative */
a = strlen(dir);
if(dir[a-1] == '\\') dir[a-1]=0;