aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/blockstore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-03 17:50:48 +0200
committerGitHub Enterprise <[email protected]>2024-04-03 17:50:48 +0200
commit4e328366efc3a2cccd286a7e191663af24dfe50d (patch)
tree931d259180bb7f54a926b5e5b46867cd7eeb4675 /src/zenstore/blockstore.cpp
parentzenremoteprojectstore with httpclient (#35) (diff)
downloadzen-4e328366efc3a2cccd286a7e191663af24dfe50d.tar.xz
zen-4e328366efc3a2cccd286a7e191663af24dfe50d.zip
validate rpc chunk responses (#36)
* Validate size of found chunks in cas/cache
Diffstat (limited to 'src/zenstore/blockstore.cpp')
-rw-r--r--src/zenstore/blockstore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp
index 69487f9dc..dfa852434 100644
--- a/src/zenstore/blockstore.cpp
+++ b/src/zenstore/blockstore.cpp
@@ -482,7 +482,11 @@ BlockStore::TryGetChunk(const BlockStoreLocation& Location) const
{
if (const Ref<BlockStoreFile>& Block = BlockIt->second; Block)
{
- return Block->GetChunk(Location.Offset, Location.Size);
+ IoBuffer Chunk = Block->GetChunk(Location.Offset, Location.Size);
+ if (Chunk.GetSize() == Location.Size)
+ {
+ return Chunk;
+ }
}
}
return IoBuffer();