diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-01 10:57:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-01 10:57:00 +0000 |
commit | 9bb5bf9f9bd2fa307ecbae246682031cce2624d9 (patch) | |
tree | 9055cd0da220a4c348b783044fd00b66bd11e468 /plugins/Db3x_mmap | |
parent | 5e918034feccd09997ba2dc170efa14c8848c8bc (diff) |
fix for a crash inside the events convertor
git-svn-id: http://svn.miranda-ng.org/main/trunk@8338 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r-- | plugins/Db3x_mmap/src/dbevents.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 0c0294297b..41782ec970 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -361,6 +361,13 @@ void CDb3Mmap::ConvertContactEvents(DBContact *cc) for (DWORD ofsEvent = cc->ofsFirstEvent; ofsEvent != 0;) {
DBEvent_094 pOld = *(DBEvent_094*)DBRead(ofsEvent, sizeof(DBEvent_094), NULL);
+ if (pOld.signature != DBEVENT_SIGNATURE)
+ break;
+
+ if (pOld.cbBlob >= 65536) {
+ ofsEvent = pOld.ofsNext;
+ continue;
+ }
memcpy(pBlob, m_pDbCache + ofsEvent + offsetof(DBEvent_094, blob), pOld.cbBlob);
DWORD ofsNew = ReallocSpace(ofsEvent, offsetof(DBEvent_094, blob) + pOld.cbBlob, offsetof(DBEvent, blob) + pOld.cbBlob);
|