1
0
Fork 0

Try to prevent a potential buffer overflow for WIN33.

This commit is contained in:
ehofman 2006-01-04 13:25:56 +00:00
parent 2080773f37
commit 0b3164c312

View file

@ -255,11 +255,11 @@ void helpCb (puObject *)
# ifdef __CYGWIN__ # ifdef __CYGWIN__
cygwin32_conv_to_full_win32_path(path.c_str(),win32_name); cygwin32_conv_to_full_win32_path(path.c_str(),win32_name);
# else # else
strcpy(win32_name,path.c_str()); strncpy(win32_name,path.c_str(), 1024);
# endif # endif
Dummy[0] = 0; Dummy[0] = 0;
FindExecutable(win32_name, Dummy, ExecName); FindExecutable(win32_name, Dummy, ExecName);
sprintf(browserParameter, "file:///%s", win32_name); snprintf(browserParameter, 1024, "file:///%s", win32_name);
ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy, ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy,
SW_SHOWNORMAL ) ; SW_SHOWNORMAL ) ;