From 3e58739f15b443090c1314c17f320bee54a897a6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 5 Dec 2020 16:12:21 +0300 Subject: =?UTF-8?q?fixes=20#2637=20(Dbx=5Fmdbx:=20=D0=9C=D0=B8=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B4=D0=B0=20=D0=BD=D0=B5=20=D0=B7=D0=B0=D0=BF=D1=83?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=D0=B5=D1=82=D1=81=D1=8F=20=D0=BF=D0=BE=D1=81?= =?UTF-8?q?=D0=BB=D0=B5=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Dbx_mdbx/src/dbsettings.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/Dbx_mdbx/src') 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); -- cgit v1.2.3