Skip to content

Commit

Permalink
Fix overflow on boundedPoll
Browse files Browse the repository at this point in the history
  • Loading branch information
JPWatson committed May 8, 2018
1 parent 290c0ad commit 23f4423
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Adaptive.Aeron/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void Position(long newPosition)

_subscriberPosition.SetOrdered(newPosition);
}

/// <summary>
/// The counter id for the subscriber position counter.
/// </summary>
Expand Down Expand Up @@ -405,7 +405,7 @@ public virtual int BoundedControlledPoll(IControlledFragmentHandler fragmentHand
var initialOffset = (int) initialPosition & _termLengthMask;
var resultingOffset = initialOffset;
var termBuffer = ActiveTermBuffer(initialPosition);
var endOffset = Math.Min(termBuffer.Capacity, (int) (maxPosition - initialPosition + initialOffset));
var endOffset = (int) Math.Min(termBuffer.Capacity, (maxPosition - initialPosition + initialOffset));
_header.Buffer = termBuffer;

try
Expand Down

0 comments on commit 23f4423

Please sign in to comment.