Merge pull request #4848 from mfleisz/longer_window_title

wfreerdp: Increase buffer size for window title (#4731)
This commit is contained in:
akallabeth 2018-09-11 08:18:33 +02:00 committed by GitHub
commit b0599afbb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)