From 2aec786828e22fe45d373c5c42853d8518ba9be8 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 2 Mar 2016 15:57:49 +0000 Subject: dbx_lmdb: buffer overrun fix git-svn-id: http://svn.miranda-ng.org/main/trunk@16393 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbmodulechain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Dbx_mdb/src/dbmodulechain.cpp b/plugins/Dbx_mdb/src/dbmodulechain.cpp index e18179ebf6..5b83d02804 100644 --- a/plugins/Dbx_mdb/src/dbmodulechain.cpp +++ b/plugins/Dbx_mdb/src/dbmodulechain.cpp @@ -96,12 +96,12 @@ DWORD CDbxMdb::GetModuleNameOfs(const char *szName) // need to create the module name int newIdx = ++m_maxModuleID; - DBModuleName *pmod = (DBModuleName*)_alloca(sizeof(DBModuleName) + nameLen); + DBModuleName *pmod = (DBModuleName*)_alloca(sizeof(DBModuleName) + nameLen + 1); pmod->dwSignature = DBMODULENAME_SIGNATURE; pmod->cbName = (char)nameLen; strcpy(pmod->name, szName); - MDB_val key = { sizeof(int), &newIdx }, data = { sizeof(DBModuleName) + nameLen, pmod }; + MDB_val key = { sizeof(int), &newIdx }, data = { sizeof(DBModuleName) + nameLen + 1, pmod }; for (;; Remap()) { txn_ptr trnlck(m_pMdbEnv); -- cgit v1.2.3