Skip to content

Validate bufferSize and prefetch bounds - #4315

Open
DragonFSKY wants to merge 1 commit into
reactor:mainfrom
DragonFSKY:4273-validate-buffer-prefetch
Open

DragonFSKY wants to merge 1 commit into
reactor:mainfrom
DragonFSKY:4273-validate-buffer-prefetch

Conversation

@DragonFSKY

@DragonFSKY DragonFSKY commented Jul 7, 2026

Copy link
Copy Markdown

Values greater than 1 << 30 overflow the internal power-of-two capacity calculation. This change validates filterWhen buffer sizes and queue-backed prefetch values before allocation, while preserving Integer.MAX_VALUE as the existing unbounded prefetch sentinel.

The affected public operators have focused boundary coverage, including the preserved unbounded behavior.

Verification:

  • ./gradlew :reactor-core:test --no-daemon
  • ./gradlew spotlessCheck --no-daemon

Fixes #4273.

@DragonFSKY
DragonFSKY requested a review from a team as a code owner July 7, 2026 09:27
Values greater than 1 << 30 can overflow
Queues.ceilingNextPowerOfTwo and lead to negative array capacities.
Validate these arguments before queue or array allocation.

Keep Integer.MAX_VALUE as the existing unbounded sentinel for
queue-backed prefetch operators.

Fixes reactor#4273.

Signed-off-by: Dongliang Xie <dragonfsky@gmail.com>
@DragonFSKY
DragonFSKY force-pushed the 4273-validate-buffer-prefetch branch from 507484a to 91eae54 Compare August 25, 2026 12:52
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.

Validate bufferSize and prefetch in operators

1 participant