summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/main.cpp
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2012-08-17 23:55:14 +0000
committerAlexander Gluzsky <sss123next@list.ru>2012-08-17 23:55:14 +0000
commitd8a969bd605c890cffabb71d3e7dfac8855a6045 (patch)
tree0372a0e5e5a36c356640f427d3e8fae462b0f448 /plugins/New_GPG/src/main.cpp
parent39b4c53fad33b800d53ebfe16634272ddd69b6c3 (diff)
fixed possible memmory corruptions
git-svn-id: http://svn.miranda-ng.org/main/trunk@1492 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/main.cpp')
-rwxr-xr-xplugins/New_GPG/src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 0c212d4e07..e28114c963 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -2261,7 +2261,7 @@ void ImportKey()
s2 = output.find("<", s);
else if(s2 > output.find("<", s))
s2 = output.find("<", s);
- tmp = new char [output.substr(s,s2-s-1).length()+1];
+ tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-1).length()+1));
strcpy(tmp, output.substr(s,s2-s-1).c_str());
mir_utf8decode(tmp, 0);
DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainName", tmp);
@@ -2273,14 +2273,14 @@ void ImportKey()
s2++;
if(output[s] == ')')
{
- tmp = new char [output.substr(s2,s-s2).length()+1];
+ tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
DBWriteContactSettingString(hContact, szGPGModuleName, "KeyComment", tmp);
mir_free(tmp);
s+=3;
s2 = output.find(">", s);
- tmp = new char [output.substr(s,s2-s).length()+1];
+ tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1));
strcpy(tmp, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp, 0);
DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", tmp);
@@ -2288,7 +2288,7 @@ void ImportKey()
}
else
{
- tmp = new char [output.substr(s2,s-s2).length()+1];
+ tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1));
strcpy(tmp, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp, 0);
DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());