security fix: replaced strcpy with safeStrCpy from backend.c
[xboard.git] / winboard / wsettings.c
index ac2c3b1..a250e2e 100644 (file)
@@ -323,7 +323,7 @@ GetOptionValues(HWND hDlg, ChessProgramState *cps)
                success = GetDlgItemText( hDlg, 2001+2*i, newText, MSG_SIZ - strlen(cps->option[j].name) - 9 );\r
                if(!success) break;\r
                changed = strcmp(cps->option[j].textValue, newText) != 0;\r
-               strcpy(cps->option[j].textValue, newText);\r
+               safeStrCpy(cps->option[j].textValue, newText, sizeof(cps->option[j].textValue)/sizeof(cps->option[j].textValue[0]) );\r
                break;\r
            case CheckBox:\r
                new = IsDlgButtonChecked( hDlg, 2000+2*i );\r
@@ -397,7 +397,7 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
 */\r
                          OPENFILENAME ofn;\r
 \r
-                         strcpy( buf, "" );\r
+                         safeStrCpy( buf, "" , sizeof( buf)/sizeof( buf[0]) );\r
 \r
                          ZeroMemory( &ofn, sizeof(ofn) );\r
 \r