diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-07-13 21:59:48 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2021-07-13 22:08:02 +0200 |
commit | c3747824367dbcbe74777c166b6d5d41d6de5dce (patch) | |
tree | f081557b6fd3fd5d572682f8397fad03fdfb148e /src/Format/Tcformat.c | |
parent | dce6d76b811f736e224550b22421ec1b963d5bd4 (diff) | |
download | VeraCrypt-c3747824367dbcbe74777c166b6d5d41d6de5dce.tar.gz VeraCrypt-c3747824367dbcbe74777c166b6d5d41d6de5dce.zip |
Windows: replace insecure wcscpy/wcscat/strcpy runtime functions with secure equivalents
This fixed failure to build driver for ARM64 with latest VS 2019
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r-- | src/Format/Tcformat.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index f12a0777..9143e8c5 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -1425,7 +1425,7 @@ void ComboSelChangeEA (HWND hwndDlg) int i, cnt = 0; nIndex = (int) SendMessage (GetDlgItem (hwndDlg, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0); - EAGetName (name, nIndex, 0); + EAGetName (name, ARRAYSIZE(name),nIndex, 0); if (wcscmp (name, L"AES") == 0) { @@ -4165,7 +4165,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea)) { if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bSystemIsGPT || EAIsMbrSysEncEnabled (ea))) - AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea); + AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ARRAYSIZE(buf),ea, 1), ea); } SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX), &nVolumeEA); @@ -5597,7 +5597,7 @@ BOOL CALLBACK PageDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa int nIndex = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETCURSEL, 0, 0); nIndex = (int) SendMessage (GetDlgItem (hCurPage, IDC_COMBO_BOX), CB_GETITEMDATA, nIndex, 0); - EAGetName (name, nIndex, 0); + EAGetName (name, ARRAYSIZE(name),nIndex, 0); if (wcscmp (name, L"AES") == 0) Applink ("aes"); @@ -6388,8 +6388,8 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa #ifdef _DEBUG // For faster testing - strcpy (szVerify, "q"); - strcpy (szRawPassword, "q"); + StringCchCopyA (szVerify, ARRAYSIZE(szVerify), "q"); + StringCchCopyA (szRawPassword, ARRAYSIZE(szRawPassword), "q"); #endif PasswordEditDropTarget* pTarget = new PasswordEditDropTarget (); @@ -7330,7 +7330,7 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa else { // Either a standard Windows boot manager or no boot manager - wcscpy_s (SysEncMultiBootCfgOutcome, sizeof(SysEncMultiBootCfgOutcome) / 2, GetString ("WINDOWS_BOOT_LOADER_HINTS")); + StringCchCopyW (SysEncMultiBootCfgOutcome, sizeof(SysEncMultiBootCfgOutcome) / 2, GetString ("WINDOWS_BOOT_LOADER_HINTS")); } } |