Skip to content

Commit

Permalink
Fix a bounds error in RocksDBEventStore.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Jan 13, 2024
1 parent bc14d67 commit 3e184df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/NexusMods.EventSourcing.RocksDB/RocksDBEventStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ public override void EventsForEntity<TIngester>(EntityId entityId, TIngester ing
BinaryPrimitives.WriteUInt64BigEndian(startKey.SliceFast(16), fromId.Value);
Span<byte> endKey = stackalloc byte[24];
entityId.TryWriteBytes(endKey);
BinaryPrimitives.WriteUInt64BigEndian(endKey.SliceFast(16), toId.Value + 1);
if (toId == TransactionId.Max)
BinaryPrimitives.WriteUInt64BigEndian(endKey.SliceFast(16), ulong.MaxValue);
else
BinaryPrimitives.WriteUInt64BigEndian(endKey.SliceFast(16), toId.Value + 1);

var options = new ReadOptions();
unsafe
Expand Down

0 comments on commit 3e184df

Please sign in to comment.