diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index e2da3d1ad80e65a665e26c746f92f0b4befa894b..a96ad7e796a24f53805372b4928680fd96d6de2d 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2877,8 +2877,13 @@ void LLSplashScreenWin32::updateImpl(const std::string& mesg) { if (!mWindow) return; + int output_str_len = MultiByteToWideChar(CP_UTF8, 0, mesg.c_str(), mesg.length(), NULL, 0); + if( output_str_len>1024 ) + return; + WCHAR w_mesg[1024]; - mbstowcs(w_mesg, mesg.c_str(), 1024); + + MultiByteToWideChar (CP_UTF8, 0, mesg.c_str(), mesg.length(), w_mesg, output_str_len); SendDlgItemMessage(mWindow, 666, // HACK: text id