wfreerdp: Increase buffer size for window title (#4731)

This commit is contained in:
Martin Fleisz 2018-09-10 14:44:29 +02:00
parent bf22ce5f5f
commit e00dd1974c
1 changed files with 4 additions and 4 deletions

View File

@ -308,7 +308,7 @@ static BOOL wf_post_connect(freerdp* instance)
rdpCache* cache; rdpCache* cache;
wfContext* wfc; wfContext* wfc;
rdpContext* context; rdpContext* context;
WCHAR lpWindowName[64]; WCHAR lpWindowName[512];
rdpSettings* settings; rdpSettings* settings;
EmbedWindowEventArgs e; EmbedWindowEventArgs e;
const UINT32 format = PIXEL_FORMAT_BGRX32; const UINT32 format = PIXEL_FORMAT_BGRX32;
@ -330,12 +330,12 @@ static BOOL wf_post_connect(freerdp* instance)
} }
if (settings->WindowTitle != NULL) if (settings->WindowTitle != NULL)
_snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"%S", settings->WindowTitle); _snwprintf_s(lpWindowName, ARRAYSIZE(lpWindowName), _TRUNCATE, L"%S", settings->WindowTitle);
else if (settings->ServerPort == 3389) else if (settings->ServerPort == 3389)
_snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S", _snwprintf_s(lpWindowName, ARRAYSIZE(lpWindowName), _TRUNCATE, L"FreeRDP: %S",
settings->ServerHostname); settings->ServerHostname);
else else
_snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S:%u", _snwprintf_s(lpWindowName, ARRAYSIZE(lpWindowName), _TRUNCATE, L"FreeRDP: %S:%u",
settings->ServerHostname, settings->ServerPort); settings->ServerHostname, settings->ServerPort);
if (settings->EmbeddedWindow) if (settings->EmbeddedWindow)