diff options
author | George Hazan <george.hazan@gmail.com> | 2013-05-06 14:40:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-05-06 14:40:36 +0000 |
commit | d1714aa0580ec116d0d95bcaabecf35fbfbfe10c (patch) | |
tree | 5236711ae2c22e7cfdeb747a0d596c4c155c0aea /protocols/Skype/src/skype_database.cpp | |
parent | 984502e64c8490ba7fb5ac0768762165953a0364 (diff) |
some crash fixes for Skype
git-svn-id: http://svn.miranda-ng.org/main/trunk@4589 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_database.cpp')
-rw-r--r-- | protocols/Skype/src/skype_database.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp index d94528c5f4..f087f96412 100644 --- a/protocols/Skype/src/skype_database.cpp +++ b/protocols/Skype/src/skype_database.cpp @@ -9,27 +9,26 @@ bool CSkypeProto::IsMessageInDB(HANDLE hContact, DWORD timestamp, const char *gu {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = ::db_event_getBlobSize(hDbEvent);
- dbei.pBlob = (PBYTE)::mir_alloc(dbei.cbBlob);
+ if (dbei.cbBlob < 32)
+ continue;
+
+ mir_ptr<BYTE> blob((PBYTE)::mir_alloc(dbei.cbBlob));
+ dbei.pBlob = blob;
::db_event_get(hDbEvent, &dbei);
if (dbei.timestamp < timestamp)
- {
- ::mir_free(dbei.pBlob);
break;
- }
int sendFlag = dbei.flags & DBEF_SENT;
if (dbei.eventType == EVENTTYPE_MESSAGE && sendFlag == flag)
{
if (::memcmp(&dbei.pBlob[dbei.cbBlob - 32], guid, 32) == 0)
{
- ::mir_free(dbei.pBlob);
result = true;
break;
}
}
- ::mir_free(dbei.pBlob);
hDbEvent = ::db_event_prev(hDbEvent);
}
|