[MLton] Bug Report -- Stack corruption
Neophytos Michael
nmichael@yahoo.com
Sat, 26 Feb 2005 06:14:31 -0800 (PST)
Function "mkstemp" in mlton/runtime/platform/mingw.c corrupts its own stack.
int mkstemp (char *template) {
char file_path[255];
char file_name[255];
char templ[4];
DWORD size;
size = sizeof (file_path);
if (0 == GetTempPath (size, file_path))
diee ("unable to make temporary file");
strncpy (templ, template, 3);
templ[4] = 0x00;
.
.
.
The last line above writes at templ[4], one past the end since the char array
only has size 4.
Neophytos
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250