summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-03-27 02:02:40 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2018-03-27 02:02:40 +0300
commit4b425310e632cd9f6fd6c7d76089d8889872bcb4 (patch)
treec2bff1b43b546a1859edeb09d8435b5b597cad91 /plugins/New_GPG/src/utilities.cpp
parente7d937cd911e3971060293a66866020333db7590 (diff)
plugins: new_gpg
- ptrA memory corruption regression fix - fixed broken xep-0027 prescense sigining regression caused by refectoring ( fixes #1131 )
Diffstat (limited to 'plugins/New_GPG/src/utilities.cpp')
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index a9acfe95af..7ec25605b9 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -694,7 +694,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
DWORD code;
std::vector<wstring> cmd;
{
- ptrA inkeyid;
+ char* inkeyid = nullptr;
char setting[64];
mir_snprintf(setting, sizeof(setting) - 1, "%s_KeyID", ji->GetModuleName());
@@ -711,8 +711,10 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
dbsetting += "_Password";
pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L"");
if (pass[0] && globals.bDebugLog)
- globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + inkeyid.get() + ", trying to encrypt message from self with password");
+ globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + inkeyid + ", trying to encrypt message from self with password");
}
+ if (inkeyid && inkeyid[0])
+ mir_free(inkeyid);
else {
pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L"");
if (pass[0] && globals.bDebugLog)
@@ -722,7 +724,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void*)
cmd.push_back(L"--passphrase");
cmd.push_back(pass.get());
}
- else if (globals.password) {
+ else if (globals.password && globals.password[0]) {
if (globals.bDebugLog)
globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to encrypt message from self with password");
cmd.push_back(L"--passphrase");