aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-06-10 14:48:56 +0200
committerGitHub Enterprise <[email protected]>2025-06-10 14:48:56 +0200
commit1442dae38a54b553d2285176f4969520332a9843 (patch)
treed385b8f5ad405e881ac1cf22f5f6448e41f89933
parentrevert 61b4a88f and cadaad63 (diff)
downloadzen-1442dae38a54b553d2285176f4969520332a9843.tar.xz
zen-1442dae38a54b553d2285176f4969520332a9843.zip
crash in composite buffer stream (#431)
* fix BufferedReadFileStream calculating buffer end wrong
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenhttp/httpclient.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7e15a2916..a0ade5cc6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
##
- Bugfix: Don't require `--namespace` option when using `zen list-namespaces` command
+- Bugfix: Crash in upload of blobs to Cloud DDC due to buffer range error
## 5.6.11
- Bugfix: Reinstate `zen builds --url` option to old behaviour, use `zen builds --cloud-url` for "Cloud Artifact URL"
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index f2b26b922..a2d323b5e 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -333,7 +333,7 @@ namespace detail {
m_Buffer = (uint8_t*)Memory::Alloc(gsl::narrow<size_t>(m_BufferSize));
}
m_BufferStart = Begin;
- m_BufferEnd = Min(Begin + m_BufferSize, m_FileSize);
+ m_BufferEnd = Min(Begin + m_BufferSize, m_FileEnd);
Read(m_Buffer, m_BufferEnd - m_BufferStart, m_BufferStart);
uint64_t Count = Min(m_BufferEnd, End) - m_BufferStart;
memcpy(WritePtr + Begin - m_FileOffset, m_Buffer, Count);