diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2013-06-14 22:05:02 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2013-06-14 22:05:02 +0000 |
commit | 45bef0474cd2f5767f74478db076c0ad8420e0ff (patch) | |
tree | 9c61690dfbd58e256de40c80ad7f07349ef84359 /protocols/Skype/src/skype_runtime.cpp | |
parent | 491549e7c5dd0a5c1c079537e68f109e958943c4 (diff) |
Skype: fix invite button in chat rooms
git-svn-id: http://svn.miranda-ng.org/main/trunk@4950 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_runtime.cpp')
-rw-r--r-- | protocols/Skype/src/skype_runtime.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/protocols/Skype/src/skype_runtime.cpp b/protocols/Skype/src/skype_runtime.cpp index a5c41d58c2..9b605d3488 100644 --- a/protocols/Skype/src/skype_runtime.cpp +++ b/protocols/Skype/src/skype_runtime.cpp @@ -18,29 +18,29 @@ char *CSkypeProto::LoadKeyPair() if (pLockedResource == NULL)
return NULL;
- aes_context ctx;
- char *key = (char*)mir_base64_decode(MY_KEY, NULL);
-
- ::aes_set_key(&ctx, (unsigned char *)key, 128);
- ::mir_free(key);
-
int length = ::SizeofResource(g_hInstance, hResource);
if (length == 0)
return NULL;
- char *pData = (char *)alloca(length+1);
- memcpy(pData, pLockedResource, length);
- pData[length] = 0;
+ char* pData = new char[length + 1];
+ ::memcpy(pData, pLockedResource, length);
+ pData[length] = 0;
- unsigned char *bufD = (unsigned char *)::mir_alloc(length * 2);
- unsigned char *tmpD = (unsigned char *)mir_base64_decode(pData, NULL);
+ unsigned char *tmpD = (unsigned char *)::mir_base64_decode(pData, NULL);
+ unsigned char *result = (unsigned char *)::mir_alloc(length*2);
+ delete [] pData;
+
+ aes_context ctx;
+ char *key = (char*)::mir_base64_decode(MY_KEY, NULL);
+ ::aes_set_key(&ctx, (unsigned char *)key, 128);
+ ::mir_free(key);
for (int i = 0; i < length; i += 16)
- aes_decrypt(&ctx, tmpD + i, bufD + i);
+ aes_decrypt(&ctx, tmpD + i, result + i);
::mir_free(tmpD);
- //bufD[length] = 0; //cert should be null terminated
- return (char *)bufD;
+ result[length] = 0;
+ return (char *)result;
}
int CSkypeProto::StartSkypeRuntime(const wchar_t *profileName)
|