From 6492b716b372d0f929f98a2965e00e10a0355204 Mon Sep 17 00:00:00 2001 From: Slávek Banko Date: Fri, 30 Nov 2018 16:17:09 +0100 Subject: Improved previous commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko Signed-off-by: Michele Calgaro --- libkpgp/kpgp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libkpgp/kpgp.cpp') diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp index a4242957..4d5120d0 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. -- cgit v1.2.3