diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-06-14 00:31:46 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2023-06-14 00:31:46 +0200 |
commit | 36a055f669547bb1e95883a8201a62f4ba58189a (patch) | |
tree | 10e1beb87b2a80d86ae0a4f9e0106263cdafe893 /src/Main/Forms/VolumePasswordPanel.cpp | |
parent | 440df023552a2a7dd9601067b96769d1eebf8506 (diff) | |
download | VeraCrypt-36a055f669547bb1e95883a8201a62f4ba58189a.tar.gz VeraCrypt-36a055f669547bb1e95883a8201a62f4ba58189a.zip |
Linux/macOS: only wipe password/PIM text controls if they are not empty
This fixes a crash on macOS with latest wxWidgets 3.2.2.1 where
GetLineLength returns -1
Diffstat (limited to 'src/Main/Forms/VolumePasswordPanel.cpp')
-rw-r--r-- | src/Main/Forms/VolumePasswordPanel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index 49c960c2..3b624340 100644 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp @@ -458,9 +458,13 @@ namespace VeraCrypt } void VolumePasswordPanel::WipeTextCtrl (wxTextCtrl *textCtrl) { - textCtrl->SetValue (wxString (L'X', textCtrl->GetLineLength(0))); + int txtLen = textCtrl->GetLineLength(0); + if (txtLen > 0) + { + textCtrl->SetValue (wxString (L'X', txtLen)); + } GetPassword (textCtrl); } bool VolumePasswordPanel::UpdatePimHelpText (bool pimChanged) |