mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
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
This commit is contained in:
@@ -459,7 +459,11 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
void VolumePasswordPanel::WipeTextCtrl (wxTextCtrl *textCtrl)
|
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);
|
GetPassword (textCtrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,11 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
PimSizer->Replace (VolumePimTextCtrl, newTextCtrl);
|
PimSizer->Replace (VolumePimTextCtrl, newTextCtrl);
|
||||||
VolumePimTextCtrl->Show (false);
|
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 ();
|
GetVolumePim ();
|
||||||
|
|
||||||
Fit();
|
Fit();
|
||||||
|
|||||||
Reference in New Issue
Block a user