summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype/src/skype.cpp')
-rw-r--r--protocols/Skype/src/skype.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp
index 9036db259b..6e953ac747 100644
--- a/protocols/Skype/src/skype.cpp
+++ b/protocols/Skype/src/skype.cpp
@@ -152,8 +152,10 @@ char* LoadKeyPair()
aes_set_key( &ctx, tmpK, 128);
int dwResSize = SizeofResource(g_hInstance, hRes);
char *pData = (char*)GlobalLock(hResource);
- pData[dwResSize] = 0;
- int basedecoded = decodeSize(pData);
+ char *pCopy = (char*)_alloca(dwResSize+1);
+ memcpy(pCopy, pData, dwResSize);
+ pCopy[dwResSize] = 0;
+ int basedecoded = decodeSize(pCopy);
GlobalUnlock(hResource);
unsigned char *bufD = (unsigned char*)mir_alloc(basedecoded + 1);
unsigned char *tmpD = (unsigned char*)mir_alloc(basedecoded + 1);