diff options
| author | Stefan Boberg <[email protected]> | 2023-12-19 10:23:03 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-19 10:23:03 +0100 |
| commit | b9aa65cfa1495eb5899cecf50d32c6f5ca027ad8 (patch) | |
| tree | fddd456c9782a57e7916703abdb53bf9e2be1af8 /src | |
| parent | fix leak in IoBuffer for manifested small chunk (#618) (diff) | |
| download | zen-b9aa65cfa1495eb5899cecf50d32c6f5ca027ad8.tar.xz zen-b9aa65cfa1495eb5899cecf50d32c6f5ca027ad8.zip | |
fix ChunkIndexToChunkHash indexing (#621)
would previously index into a reserved-but-not-sized vector which is bad but not crash-inducing bad
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/cache/cachedisklayer.cpp | 2 | ||||
| -rw-r--r-- | src/zenstore/compactcas.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/zenserver/cache/cachedisklayer.cpp b/src/zenserver/cache/cachedisklayer.cpp index fc6adb989..8d046105d 100644 --- a/src/zenserver/cache/cachedisklayer.cpp +++ b/src/zenserver/cache/cachedisklayer.cpp @@ -2307,7 +2307,7 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) BlockStoreLocation Location = DiskLocation.GetBlockLocation(m_Configuration.PayloadAlignment); size_t ChunkIndex = ChunkLocations.size(); ChunkLocations.push_back(Location); - ChunkIndexToChunkHash[ChunkIndex] = Key; + ChunkIndexToChunkHash.push_back(Key); if (ExpiredCacheKeys.contains(Key)) { continue; diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp index c60f97a24..64c1dadf8 100644 --- a/src/zenstore/compactcas.cpp +++ b/src/zenstore/compactcas.cpp @@ -471,7 +471,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) size_t ChunkIndex = ChunkLocations.size(); ChunkLocations.push_back(Location); - ChunkIndexToChunkHash[ChunkIndex] = ChunkHash; + ChunkIndexToChunkHash.push_back(ChunkHash); if (Keep) { KeepChunkIndexes.push_back(ChunkIndex); |