aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-12-10 23:57:12 +0100
committerGitHub Enterprise <[email protected]>2025-12-10 23:57:12 +0100
commit1425e5d1b2d528cb6f99c73f7660fc7cc65a2e68 (patch)
treec444bfa0b77c0157622a36c30200fefd4adfbd69
parentchangelog (diff)
downloadzen-1425e5d1b2d528cb6f99c73f7660fc7cc65a2e68.tar.xz
zen-1425e5d1b2d528cb6f99c73f7660fc7cc65a2e68.zip
fix zero length stream decompress (#685)
* fix validation during stream decompress of zero-size rawsize
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zencore/compress.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c615e527a..81bd6e266 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
- Bugfix: Resume download in http client no longer tries to read from a stale header iterator
- Bugfix: Zen builds cache background upload work no longer keeps memory mapped buffers alive in backlog queue
- Bugfix: If no chunks in a batch put operation needs to be written we no longer call the write operation which resulted in an ASSERT
+- Bugfix: Compressed buffers with zero size payload failed to decompress with "none" stream decompression
## 5.7.13
- Feature: Added `--append` option to `zen builds download`
diff --git a/src/zencore/compress.cpp b/src/zencore/compress.cpp
index 5375a9f1d..25ed0fc46 100644
--- a/src/zencore/compress.cpp
+++ b/src/zencore/compress.cpp
@@ -340,7 +340,7 @@ public:
const final
{
if (Header.Method == CompressionMethod::None && Header.TotalCompressedSize == CompressedData.GetSize() &&
- Header.TotalCompressedSize == Header.TotalRawSize + sizeof(BufferHeader) && RawOffset < Header.TotalRawSize &&
+ Header.TotalCompressedSize == Header.TotalRawSize + sizeof(BufferHeader) && RawOffset <= Header.TotalRawSize &&
(RawOffset + RawSize) <= Header.TotalRawSize)
{
bool Result = true;