diff options
| author | Dan Engelbrecht <[email protected]> | 2025-12-10 23:57:12 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-12-10 23:57:12 +0100 |
| commit | 1425e5d1b2d528cb6f99c73f7660fc7cc65a2e68 (patch) | |
| tree | c444bfa0b77c0157622a36c30200fefd4adfbd69 | |
| parent | changelog (diff) | |
| download | zen-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.md | 1 | ||||
| -rw-r--r-- | src/zencore/compress.cpp | 2 |
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; |