aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpclient.cpp
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 /src/zenhttp/httpclient.cpp
parentrevert 61b4a88f and cadaad63 (diff)
downloadzen-1442dae38a54b553d2285176f4969520332a9843.tar.xz
zen-1442dae38a54b553d2285176f4969520332a9843.zip
crash in composite buffer stream (#431)
* fix BufferedReadFileStream calculating buffer end wrong
Diffstat (limited to 'src/zenhttp/httpclient.cpp')
-rw-r--r--src/zenhttp/httpclient.cpp2
1 files changed, 1 insertions, 1 deletions
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);