From: H.G.Muller Date: Tue, 5 Jul 2022 13:56:05 +0000 (+0200) Subject: Fix Browse button generic popup WinBoard X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=fd0a120b02250a4df3737f79b5ebce6e81673999;p=xboard.git 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.) --- 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);