aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/iobuffer.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-05-21 15:05:40 +0200
committerGitHub Enterprise <[email protected]>2024-05-21 15:05:40 +0200
commitad464941474173a9ba8d860c88db4689611d50a6 (patch)
tree0ad55427fa3b3b70551c5b0c860a77aa0ba29639 /src/zencore/iobuffer.cpp
parentrefactor BlockStore IterateChunks (#77) (diff)
downloadzen-ad464941474173a9ba8d860c88db4689611d50a6.tar.xz
zen-ad464941474173a9ba8d860c88db4689611d50a6.zip
iobuffer memstomp fix (#85)
* Don't try to validate empty compact binary * Don't try to free fake memory buffer pointer in iobuffer destructor
Diffstat (limited to 'src/zencore/iobuffer.cpp')
-rw-r--r--src/zencore/iobuffer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/zencore/iobuffer.cpp b/src/zencore/iobuffer.cpp
index e1e8750a1..fd99a01cb 100644
--- a/src/zencore/iobuffer.cpp
+++ b/src/zencore/iobuffer.cpp
@@ -212,6 +212,10 @@ IoBufferExtendedCore::~IoBufferExtendedCore()
m_DataPtr = nullptr; // prevent any buffer deallocation attempts
}
+ else if (m_DataPtr == reinterpret_cast<uint8_t*>(&m_MmapHandle))
+ {
+ m_DataPtr = nullptr;
+ }
const uint32_t LocalFlags = m_Flags.load(std::memory_order_relaxed);
#if ZEN_PLATFORM_WINDOWS