Add robustness against null models

This commit is contained in:
Wladimir J. van der Laan
2011-11-08 21:18:36 +01:00
parent 0fb0a38339
commit dead0ff8cd
11 changed files with 172 additions and 99 deletions

View File

@@ -72,6 +72,8 @@ void AskPassphraseDialog::setModel(WalletModel *model)
void AskPassphraseDialog::accept()
{
std::string oldpass, newpass1, newpass2;
if(!model)
return;
// TODO: mlock memory / munlock on return so they will not be swapped out, really need "mlockedstring" wrapper class to do this safely
oldpass.reserve(MAX_PASSPHRASE_SIZE);
newpass1.reserve(MAX_PASSPHRASE_SIZE);