From 5eb20cb91abe54d7b8de5c893da40dfe1719ea2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Luc=20Peuri=C3=A8re?= Date: Tue, 20 Jun 2006 20:24:07 +0000 Subject: fix of the previous security patch for file opening on Os X. nobody noticed it was broken for 3 month ;) --- intern/ghost/intern/GHOST_SystemCarbon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'intern') 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; -- cgit v1.2.3