summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-12-05 16:12:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-12-05 16:12:26 +0300
commit3e58739f15b443090c1314c17f320bee54a897a6 (patch)
tree4a1d460989388f39a6f57821fe2ab7afb217eeb3 /plugins/Dbx_mdbx/src
parentff95eede6a42ae9499e8857d208afd6d48bf1c71 (diff)
fixes #2637 (Dbx_mdbx: Миранда не запускается после обновления)
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbsettings.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/Dbx_mdbx/src/dbsettings.cpp b/plugins/Dbx_mdbx/src/dbsettings.cpp
index 7add1847a4..ba8804afdc 100644
--- a/plugins/Dbx_mdbx/src/dbsettings.cpp
+++ b/plugins/Dbx_mdbx/src/dbsettings.cpp
@@ -46,8 +46,10 @@ void CDbxMDBX::FillSettings()
char *szCachedSettingName = m_cache->GetCachedSetting(szModule, pKey->szSettingName, moduleNameLen, settingNameLen);
DBVARIANT *dbv = m_cache->GetCachedValuePtr(pKey->hContact, szCachedSettingName, 1);
+ if (dbv == nullptr) // garbage! a setting for removed/non-existent contact
+ continue;
- size_t varLen;
+ WORD varLen;
BYTE iType = dbv->type = pBlob[0]; pBlob++;
switch (iType) {
@@ -184,10 +186,10 @@ LBL_Seek:
if (isStatic) {
dbv->cchVal--;
if (realLen < dbv->cchVal)
- dbv->cchVal = realLen;
+ dbv->cchVal = WORD(realLen);
memcpy(dbv->pszVal, decoded, dbv->cchVal);
dbv->pszVal[dbv->cchVal] = 0;
- dbv->cchVal = realLen;
+ dbv->cchVal = WORD(realLen);
}
else {
dbv->pszVal = (char *)mir_alloc(1 + realLen);