diff options
author | George Hazan <ghazan@miranda.im> | 2020-12-13 12:15:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-12-13 12:15:31 +0300 |
commit | 244d024f27a94f1b88d0079b8d9042c98f546f46 (patch) | |
tree | df376f3ac45c89b1f7b49fc1fe59b1040e488e6d /plugins/Dbx_mdbx/src | |
parent | fb6ea0ff7cf994571ba026b05a57ef8320851b86 (diff) |
Dbx_mdbx: crash fix when deleting sub-contact from a meta
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r-- | plugins/Dbx_mdbx/src/dbcontacts.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcontacts.cpp b/plugins/Dbx_mdbx/src/dbcontacts.cpp index 47a23254c4..d650909089 100644 --- a/plugins/Dbx_mdbx/src/dbcontacts.cpp +++ b/plugins/Dbx_mdbx/src/dbcontacts.cpp @@ -214,8 +214,9 @@ BOOL CDbxMDBX::MetaRemoveSubHistory(DBCachedContact *ccSub) {
MDBX_val key = { &EI->eventId, sizeof(MEVENT) }, data;
if (mdbx_get(trnlck, m_dbEvents, &key, &data) == MDBX_SUCCESS) {
- DBEvent *pEvent = (DBEvent*)data.iov_base;
- pEvent->dwContactID = ccSub->parentID;
+ DBEvent tmp = *(DBEvent*)data.iov_base;
+ tmp.dwContactID = ccSub->parentID;
+ data.iov_base = &tmp;
if (mdbx_put(trnlck, m_dbEvents, &key, &data, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
}
|