diff options
author | Slávek Banko <[email protected]> | 2018-11-30 16:17:09 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2018-11-30 16:24:31 +0100 |
commit | 6492b716b372d0f929f98a2965e00e10a0355204 (patch) | |
tree | 45a233b3f64424bea40533578150d392fa07b704 /libkpgp/kpgp.cpp | |
parent | 2e5de46030e2354b851ba731f6c76ac30a2e8a3b (diff) | |
download | tdepim-6492b716b372d0f929f98a2965e00e10a0355204.tar.gz tdepim-6492b716b372d0f929f98a2965e00e10a0355204.zip |
Improved previous commit
Signed-off-by: Slávek Banko <[email protected]>
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'libkpgp/kpgp.cpp')
-rw-r--r-- | libkpgp/kpgp.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp index a42429573..4d5120d0e 100644 --- a/libkpgp/kpgp.cpp +++ b/libkpgp/kpgp.cpp @@ -55,7 +55,7 @@ Module::Module() mPublicKeysCached(false), mSecretKeys(), mSecretKeysCached(false), - passphrase(0), havePassPhrase(false) + passphrase(TQString::null), havePassPhrase(false) { if (!kpgpObject) { kdDebug(5100) << "creating new pgp object" << endl; @@ -230,8 +230,8 @@ Module::wipePassPhrase(bool freeMem) if (!passphrase.isEmpty()) { passphrase.fill(' '); } - if (freeMem && !passphrase.isNull()) { - passphrase = TQString(); + if (freeMem) { + passphrase.truncate(0); } havePassPhrase = false; } @@ -830,13 +830,13 @@ Module::getAsciiPublicKey(const KeyID& keyID) } -bool Module::setPassPhrase(const TQString& aPass) +bool Module::setPassPhrase(const TQString &aPass) { // null out old buffer before we touch the new string. So in case // aPass isn't properly null-terminated, we don't leak secret data. wipePassPhrase(); - if (!aPass.isNull()) + if (!aPass.isEmpty()) { if (aPass.length() >= 1024) { // rediculously long passphrase. |