Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@epickrram
Copy link
Contributor

Fixes an infinite loop when calculated newCapacity overflows:

final int newCapacity = Math.max(capacity + (capacity >> 1), MIN_ALLOCATED_CAPACITY);
// newCapacity is never negative, as Math.max returns MIN_ALLOCATED_CAPACITY
// when capacity + (capacity >> 1) overflows
if (newCapacity < 0 || newCapacity > MAX_CAPACITY)

Extracted utility method out to separate class to facilitate testing.

@mjpt777 mjpt777 merged commit 0bdb6c7 into aeron-io:master Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants