]> git.mxchange.org Git - flightgear.git/commitdiff
Try to prevent a potential buffer overflow for WIN33.
authorehofman <ehofman>
Wed, 4 Jan 2006 13:25:56 +0000 (13:25 +0000)
committerehofman <ehofman>
Wed, 4 Jan 2006 13:25:56 +0000 (13:25 +0000)
src/GUI/gui_funcs.cxx

index 784e6c5f48aae7a8c80ed4d12b0f78f3fe38172c..ddcc3e9a4a961e114e4ebbf482bd962e7c5577f1 100644 (file)
@@ -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 ) ;