diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-28 11:03:16 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-28 11:03:16 +0000 |
commit | 010e4df16c3fc963155cd1e398748d2b15974e3e (patch) | |
tree | 1ea54adb1e75d9781402948da7723653a8ccd59b /protocols/Skype | |
parent | b20547300df739d3df7d22fd78895427f4720e1d (diff) |
fixed memmory corruption
git-svn-id: http://svn.miranda-ng.org/main/trunk@2098 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype')
-rw-r--r-- | protocols/Skype/src/skype.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp index 909065ad27..d8428b9b6a 100644 --- a/protocols/Skype/src/skype.cpp +++ b/protocols/Skype/src/skype.cpp @@ -147,15 +147,14 @@ char* LoadKeyPair() pData[dwResSize] = 0;
int basedecoded = decodeSize(pData);
GlobalUnlock(hResource);
- GlobalFree(hResource);
unsigned char *bufD = (unsigned char*)mir_alloc(basedecoded + 1);
unsigned char *tmpD = (unsigned char*)mir_alloc(basedecoded + 1);
decode(pData, tmpD, basedecoded);
- for (int i = 0; i <= basedecoded; i += 16) {
+ for (int i = 0; i < basedecoded; i += 16) {
aes_decrypt(&ctx, tmpD+i, bufD+i);
}
mir_free(tmpD);
- bufD[basedecoded-1] = 0; //cert should be null terminated + bufD[basedecoded] = 0; //cert should be null terminated return (char*)bufD;
}
return NULL;
|