From 5c1e5146728e8bbbc97c521f7f7dc6837f681e0e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 15 Sep 2024 18:49:34 +0300 Subject: =?UTF-8?q?fixes=20#4676=20(NewStory:=20=D1=81=D0=BE=D0=BE=D0=B1?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=BF=D0=B0?= =?UTF-8?q?=D0=B4=D0=B0=D0=B5=D1=82=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B2=20=D0=B7=D0=B0=D0=BA=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Dbx_sqlite/src/dbevents.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp') diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 3071373b5b..a376f9e8ca 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -266,14 +266,17 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei) DBEVENTINFO tmp = *dbei; mir_ptr pCryptBlob; - if (m_bEncrypted && tmp.pBlob) { - size_t len; - char *pResult = (char*)m_crypto->encodeBuffer(tmp.pBlob, tmp.cbBlob, &len); - if (pResult != nullptr) { - pCryptBlob = tmp.pBlob = pResult; - tmp.cbBlob = (uint16_t)len; - tmp.flags |= DBEF_ENCRYPTED; + if (m_bEncrypted) { + if (tmp.pBlob) { + size_t len; + char *pResult = (char *)m_crypto->encodeBuffer(tmp.pBlob, tmp.cbBlob, &len); + if (pResult != nullptr) { + pCryptBlob = tmp.pBlob = pResult; + tmp.cbBlob = (uint16_t)len; + tmp.flags |= DBEF_ENCRYPTED; + } } + else tmp.flags |= DBEF_ENCRYPTED; } mir_cslockfull lock(m_csDbAccess); -- cgit v1.2.3