VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePimWizardPage.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-14 00:31:46 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2023-06-14 00:31:46 +0200
commit36a055f669547bb1e95883a8201a62f4ba58189a (patch)
tree10e1beb87b2a80d86ae0a4f9e0106263cdafe893 /src/Main/Forms/VolumePimWizardPage.cpp
parent440df023552a2a7dd9601067b96769d1eebf8506 (diff)
downloadVeraCrypt-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/VolumePimWizardPage.cpp')
-rw-r--r--src/Main/Forms/VolumePimWizardPage.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Main/Forms/VolumePimWizardPage.cpp b/src/Main/Forms/VolumePimWizardPage.cpp
index 7ef8a3a0..c4f7014b 100644
--- a/src/Main/Forms/VolumePimWizardPage.cpp
+++ b/src/Main/Forms/VolumePimWizardPage.cpp
@@ -110,7 +110,11 @@ namespace VeraCrypt
PimSizer->Replace (VolumePimTextCtrl, newTextCtrl);
VolumePimTextCtrl->Show (false);
- VolumePimTextCtrl->SetValue (wxString (L'X', VolumePimTextCtrl->GetLineLength(0)));
+ int txtLen = VolumePimTextCtrl->GetLineLength(0);
+ if (txtLen > 0)
+ {
+ VolumePimTextCtrl->SetValue (wxString (L'X', txtLen));
+ }
GetVolumePim ();
Fit();