mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 02:58:02 -06:00
Windows: Fix wrong error message when UTF-8 encoding of entered password exceeds the maximum supported length.
This commit is contained in:
@@ -13251,7 +13251,6 @@ BOOL GetPassword (HWND hwndDlg, UINT ctrlID, char* passValue, int bufSize, BOOL
|
||||
passValue [0] = 0;
|
||||
if (bShowError)
|
||||
{
|
||||
SetFocus (GetDlgItem(hwndDlg, ctrlID));
|
||||
if (GetLastError () == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
DWORD dwTextSize = (DWORD) wcslen (GetString ("PASSWORD_UTF8_TOO_LONG")) + 16;
|
||||
@@ -13266,6 +13265,7 @@ BOOL GetPassword (HWND hwndDlg, UINT ctrlID, char* passValue, int bufSize, BOOL
|
||||
}
|
||||
else
|
||||
Error ("PASSWORD_UTF8_INVALID", hwndDlg);
|
||||
SetFocus (GetDlgItem(hwndDlg, ctrlID));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user