1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0022378: Small patch to fix buffer vulnerability of Draw

This commit is contained in:
SZY 2011-11-18 09:58:53 +00:00 committed by bugmaster
parent 2b442de5ec
commit 4b943aab31

View File

@ -1945,8 +1945,9 @@ static Tk_Window mainWindow;
//* threads sinchronization *//
DWORD dwMainThreadId;
console_semaphore_value volatile console_semaphore = WAIT_CONSOLE_COMMAND;
char console_command[1000];
//char console_command[1000];
#define COMMAND_SIZE 1000 /* Console Command size */
char console_command[COMMAND_SIZE];
bool volatile isTkLoopStarted = false;
/*--------------------------------------------------------*\
@ -2025,7 +2026,8 @@ static DWORD WINAPI readStdinThreadFunc(VOID)
while (1) {
while (console_semaphore != WAIT_CONSOLE_COMMAND)
Sleep(100);
if (gets(console_command))
//if (gets(console_command))
if (fgets(console_command,COMMAND_SIZE,stdin))
{
console_semaphore = HAS_CONSOLE_COMMAND;
}