From 0b3164c3126a1f8a9161847b983226d94a27cc29 Mon Sep 17 00:00:00 2001 From: ehofman Date: Wed, 4 Jan 2006 13:25:56 +0000 Subject: [PATCH] Try to prevent a potential buffer overflow for WIN33. --- src/GUI/gui_funcs.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 784e6c5f4..ddcc3e9a4 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -255,11 +255,11 @@ void helpCb (puObject *) # ifdef __CYGWIN__ cygwin32_conv_to_full_win32_path(path.c_str(),win32_name); # else - strcpy(win32_name,path.c_str()); + strncpy(win32_name,path.c_str(), 1024); # endif Dummy[0] = 0; FindExecutable(win32_name, Dummy, ExecName); - sprintf(browserParameter, "file:///%s", win32_name); + snprintf(browserParameter, 1024, "file:///%s", win32_name); ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy, SW_SHOWNORMAL ) ; -- 2.39.5