From 9717de57613d2a5f56895fdf8e674d2c919073e5 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 25 Feb 2013 15:48:25 +0000 Subject: fixed crash in x64 git-svn-id: http://svn.miranda-ng.org/main/trunk@3769 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/Skype_11.vcxproj | 8 -------- protocols/Skype/Skype_11.vcxproj.filters | 8 -------- protocols/Skype/src/resource.h | 2 +- protocols/Skype/src/skype_subclassing.cpp | 16 ++++++++++------ 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/protocols/Skype/Skype_11.vcxproj b/protocols/Skype/Skype_11.vcxproj index e5e6537991..9ee8ebf0dd 100644 --- a/protocols/Skype/Skype_11.vcxproj +++ b/protocols/Skype/Skype_11.vcxproj @@ -217,14 +217,6 @@ - - - - - - - - diff --git a/protocols/Skype/Skype_11.vcxproj.filters b/protocols/Skype/Skype_11.vcxproj.filters index 72884a0675..f3c307bd41 100644 --- a/protocols/Skype/Skype_11.vcxproj.filters +++ b/protocols/Skype/Skype_11.vcxproj.filters @@ -101,12 +101,4 @@ Resource Filess - - - - - - - - \ No newline at end of file diff --git a/protocols/Skype/src/resource.h b/protocols/Skype/src/resource.h index 053e98e51e..c6c95bbde4 100644 --- a/protocols/Skype/src/resource.h +++ b/protocols/Skype/src/resource.h @@ -8,6 +8,7 @@ #define IDD_OPT_MAIN 10 #define IDD_INFO_SKYPE 11 #define IDD_OWNINFO_SKYPE 12 +#define IDD_PASSWORD_CHANGE 13 #define IDD_CHATROOM_INVITE 40 #define IDI_ICON 101 #define IDR_RUNTIME 102 @@ -17,7 +18,6 @@ #define IDD_PASSWORDREQUEST 106 #define IDD_PASSWORD_REQUEST 106 #define IDR_KEY 107 -#define IDD_PASSWORD_CHANGE 107 #define IDC_CCLIST 173 #define IDC_EDITSCR 174 #define IDC_ADDSCR 175 diff --git a/protocols/Skype/src/skype_subclassing.cpp b/protocols/Skype/src/skype_subclassing.cpp index 7c7d91d3eb..10bdecf9d5 100644 --- a/protocols/Skype/src/skype_subclassing.cpp +++ b/protocols/Skype/src/skype_subclassing.cpp @@ -116,7 +116,7 @@ Cleanup: char *CSkype::LoadKeyPair(HINSTANCE hInstance) { - HRSRC hRes = FindResource(hInstance, MAKEINTRESOURCE(/*IDR_KEY*/107), L"BIN"); + HRSRC hRes = FindResource(hInstance, MAKEINTRESOURCE(IDR_KEY), L"BIN"); if (hRes) { HGLOBAL hResource = LoadResource(hInstance, hRes); @@ -127,11 +127,12 @@ char *CSkype::LoadKeyPair(HINSTANCE hInstance) int basedecoded = Base64::Decode(MY_KEY, (char *)key, MAX_PATH); ::aes_set_key(&ctx, key, 128); + memset(key, 0, sizeof(key)); - int dwResSize = ::SizeofResource(hInstance, hRes); - char *pData = (char *)::GlobalLock(hResource); - basedecoded = dwResSize; - ::GlobalUnlock(hResource); + basedecoded = ::SizeofResource(hInstance, hRes); + char *pData = (char *)hResource; + if (!pData) + return NULL; unsigned char *bufD = (unsigned char*)::malloc(basedecoded + 1); unsigned char *tmpD = (unsigned char*)::malloc(basedecoded + 1); @@ -274,7 +275,10 @@ CSkype *CSkype::GetInstance(HINSTANCE hInstance, const wchar_t *profileName, con int port = 8963; if (!CSkype::StartSkypeRuntime(hInstance, profileName, port, dbPath)) return NULL; - char *keyPair = CSkype::LoadKeyPair(hInstance); + + char *keyPair = CSkype::LoadKeyPair(hInstance); + if (!keyPair) + return NULL; CSkype *skype = new CSkype(); TransportInterface::Status status = skype->init(keyPair, "127.0.0.1", port, 0, 2, 3); -- cgit v1.2.3