diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-26 17:49:35 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-26 17:49:35 +0000 |
commit | ae3d8dc30d0f8deb28d7dcebb3bc839ceee02bee (patch) | |
tree | eee5a512238c943352ca483d395036a87bd224bb /protocols/Skype/src/skype_events.cpp | |
parent | b3d59c0b3b4009e0d86c9eb858bb9131b815413b (diff) |
Skype: memory corruption fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@4537 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_events.cpp')
-rw-r--r-- | protocols/Skype/src/skype_events.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index 56fc74a695..d7b120e074 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -54,8 +54,8 @@ int CSkypeProto::OnMessagePreCreate(WPARAM, LPARAM lParam) SEBinary guid;
if (message->GetPropGuid(guid))
{
- evt->dbei->pBlob = (PBYTE)::mir_realloc(evt->dbei->pBlob, guid.size() + 1);
- ::strncpy((char *)&evt->dbei->pBlob[evt->dbei->cbBlob], guid.data(), guid.size());
+ evt->dbei->pBlob = (PBYTE)::mir_realloc(evt->dbei->pBlob, evt->dbei->cbBlob + guid.size());
+ ::memcpy((char *)&evt->dbei->pBlob[evt->dbei->cbBlob], guid.data(), guid.size());
}
return 1;
@@ -441,26 +441,26 @@ void CSkypeProto::OnMessage(CConversation::Ref conversation, CMessage::Ref messa }
break;
- case CMessage::STARTED_LIVESESSION: - //conversation->LeaveLiveSession(); - + case CMessage::STARTED_LIVESESSION:
+ //conversation->LeaveLiveSession();
+
uint timestamp;
- message->GetPropTimestamp(timestamp); - + message->GetPropTimestamp(timestamp);
+
SEString identity;
message->GetPropAuthor(identity);
CContact::Ref author;
- g_skype->GetContact(identity, author); - - HANDLE hContact = this->AddContact(author); - - wchar_t *message = new wchar_t[14]; - ::wcscpy(message, L"Incoming call"); - - this->AddDataBaseEvent( - hContact, - SKYPE_DB_EVENT_TYPE_CALL, + g_skype->GetContact(identity, author);
+
+ HANDLE hContact = this->AddContact(author);
+
+ wchar_t *message = new wchar_t[14];
+ ::wcscpy(message, L"Incoming call");
+
+ this->AddDataBaseEvent(
+ hContact,
+ SKYPE_DB_EVENT_TYPE_CALL,
timestamp,
DBEF_UTF,
(DWORD)::wcslen(message) + 1,
|