From fd0a120b02250a4df3737f79b5ebce6e81673999 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 5 Jul 2022 15:56:05 +0200 Subject: [PATCH] Fix Browse button generic popup WinBoard The API call to the file selector left some fields in the OPENFILENAME struct that was passed to it as argument uninitialized. It seems this could crash WinBoard if they contained unlcky values. (Which they might, as the struct was a local variable.) --- winboard/wsettings.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/winboard/wsettings.c b/winboard/wsettings.c index b65566c..dd9cabb 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -512,7 +512,10 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa ofn.hwndOwner = hDlg; ofn.hInstance = hInst; ofn.lpstrFilter = filter; + ofn.lpstrCustomFilter = (LPSTR) NULL; ofn.nFilterIndex = 1L + (ext = activeCps ? 0 : activeList[layoutList[(i-2000)/2+1]].max & 31); + ofn.lpstrFileTitle = NULL; + ofn.lpstrInitialDir = NULL; ofn.lpstrDefExt = defaultExt[ext]; ofn.lpstrFile = buf; ofn.nMaxFile = sizeof(buf); -- 1.7.0.4