mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08: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;
|
passValue [0] = 0;
|
||||||
if (bShowError)
|
if (bShowError)
|
||||||
{
|
{
|
||||||
SetFocus (GetDlgItem(hwndDlg, ctrlID));
|
|
||||||
if (GetLastError () == ERROR_INSUFFICIENT_BUFFER)
|
if (GetLastError () == ERROR_INSUFFICIENT_BUFFER)
|
||||||
{
|
{
|
||||||
DWORD dwTextSize = (DWORD) wcslen (GetString ("PASSWORD_UTF8_TOO_LONG")) + 16;
|
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
|
else
|
||||||
Error ("PASSWORD_UTF8_INVALID", hwndDlg);
|
Error ("PASSWORD_UTF8_INVALID", hwndDlg);
|
||||||
|
SetFocus (GetDlgItem(hwndDlg, ctrlID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user