diff options
author | Jean-Luc Peurière <jlp@nerim.net> | 2006-06-21 00:24:07 +0400 |
---|---|---|
committer | Jean-Luc Peurière <jlp@nerim.net> | 2006-06-21 00:24:07 +0400 |
commit | 5eb20cb91abe54d7b8de5c893da40dfe1719ea2c (patch) | |
tree | 68a31a6c70a5420f4a453bab02b706364c19f977 /intern | |
parent | 0deed7d1d7ee2a907834bc5f0f9ed81a1ed42e31 (diff) |
fix of the previous security patch for file opening on Os X.
nobody noticed it was broken for 3 month ;)
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCarbon.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp index 49a49914576..ef9e91ec3df 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp @@ -522,13 +522,14 @@ GHOST_TSuccess GHOST_SystemCarbon::getButtons(GHOST_Buttons& buttons) const return GHOST_kSuccess; } +#define FIRSTFILEBUFLG 512 static bool g_hasFirstFile = false; static char g_firstFileBuf[512]; -extern "C" int GHOST_HACK_getFirstFile(char buf[512]) { +extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) { if (g_hasFirstFile) { - strncpy(buf, g_firstFileBuf, sizeof(buf) - 1); - buf[sizeof(buf) - 1] = '\0'; + strncpy(buf, g_firstFileBuf, FIRSTFILEBUFLG - 1); + buf[FIRSTFILEBUFLG - 1] = '\0'; return 1; } else { return 0; |