aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zenserver/projectstore/projectstore.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index 438943f75..a6f058cf4 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -3185,6 +3185,19 @@ ProjectStore::GetChunkRange(const std::string_view ProjectId,
Size = RawSize - Offset;
}
+ if (Size == 0)
+ {
+ return {
+ HttpResponseCode::NotFound,
+ fmt::format("Chunk request for range outside of chunk '{}/{}'. Request: Chunk: {}, Offset: {}, Size: {}, ChunkSize: {}",
+ ProjectId,
+ OplogId,
+ ChunkId,
+ Offset,
+ Size,
+ RawSize)};
+ }
+
if (AcceptType == ZenContentType::kBinary)
{
OutChunk = CompositeBuffer(Compressed.Decompress(Offset, Size));
@@ -3216,6 +3229,19 @@ ProjectStore::GetChunkRange(const std::string_view ProjectId,
{
Size = Chunk.GetSize() - Offset;
}
+
+ if (Size == 0)
+ {
+ return {HttpResponseCode::NotFound,
+ fmt::format("Chunk request for range outside of chunk '{}/{}'. Request: Chunk: {}, Offset: {}, Size: {}, ChunkSize: {}",
+ ProjectId,
+ OplogId,
+ ChunkId,
+ Offset,
+ Size,
+ Chunk.GetSize())};
+ }
+
OutChunk = CompositeBuffer(SharedBuffer(IoBuffer(std::move(Chunk), Offset, Size)));
}
else