[FONTVIEW] Ensure the extension filter is properly double-null terminated

This commit is contained in:
Mark Jansen 2020-05-11 20:52:30 +02:00
parent b22484b533
commit 909f50a857
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -126,10 +126,10 @@ wWinMain(HINSTANCE hThisInstance,
if (argc < 2)
{
OPENFILENAMEW fontOpen;
WCHAR filter[MAX_PATH*2], dialogTitle[MAX_PATH];
WCHAR filter[MAX_PATH*2] = {0}, dialogTitle[MAX_PATH];
LoadStringW(NULL, IDS_OPEN, dialogTitle, ARRAYSIZE(dialogTitle));
LoadStringW(NULL, IDS_FILTER_LIST, filter, ARRAYSIZE(filter));
LoadStringW(NULL, IDS_FILTER_LIST, filter, ARRAYSIZE(filter) - 1);
/* Clears out any values of fontOpen before we use it */
ZeroMemory(&fontOpen, sizeof(fontOpen));