aboutsummaryrefslogtreecommitdiff
path: root/zencore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-06-14 23:37:05 +0200
committerDan Engelbrecht <[email protected]>2022-06-15 00:03:40 +0200
commit0ba3a7d1c67de9b6d94f835f6e90a1f2e115f94c (patch)
tree67297329596bb3fca10a879a0dddfac9c9d8a7af /zencore
parentreview feedback (diff)
downloadzen-0ba3a7d1c67de9b6d94f835f6e90a1f2e115f94c.tar.xz
zen-0ba3a7d1c67de9b6d94f835f6e90a1f2e115f94c.zip
Make sure we don't try to create a ZipFS IoBuffer of zero size
Diffstat (limited to 'zencore')
-rw-r--r--zencore/iobuffer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/zencore/iobuffer.cpp b/zencore/iobuffer.cpp
index 56b05d86d..37ef57c2d 100644
--- a/zencore/iobuffer.cpp
+++ b/zencore/iobuffer.cpp
@@ -274,6 +274,8 @@ IoBufferExtendedCore::Materialize() const
const uint64_t MappedOffsetDisplacement = m_FileOffset - MapOffset;
const uint64_t MapSize = m_DataBytes + MappedOffsetDisplacement;
+ ZEN_ASSERT(MapSize > 0);
+
#if ZEN_PLATFORM_WINDOWS
NewMmapHandle = CreateFileMapping(m_FileHandle,
/* lpFileMappingAttributes */ nullptr,