Skip to content

Auto-port 4.1: Reject negative maxOrder in PooledByteBufAllocator - #17095

Merged
normanmaurer merged 1 commit into
4.1from
auto-port-pr-17093-to-4.1
Jul 18, 2026
Merged

normanmaurer merged 1 commit into
4.1from
auto-port-pr-17093-to-4.1

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17093 to 4.1
Cherry-picked commit: 010b6e8


Motivation:

The valid range of maxOrder is 0 to 14, but negative values were accepted because only the upper bound was validated. When configured through io.netty.allocator.maxOrder, a negative value may result in an invalid chunk size during static initialization.

Modification:

Validate the lower bound of maxOrder and add a regression test.

Result:

Negative maxOrder values are rejected with an IllegalArgumentException.

Motivation:

The valid range of `maxOrder` is 0 to 14, but negative values were
accepted because only the upper bound was validated. When configured
through `io.netty.allocator.maxOrder`, a negative value may result in an
invalid chunk size during static initialization.

Modification:

Validate the lower bound of `maxOrder` and add a regression test.

Result:

Negative `maxOrder` values are rejected with an
`IllegalArgumentException`.

(cherry picked from commit 010b6e8)
@normanmaurer
normanmaurer force-pushed the auto-port-pr-17093-to-4.1 branch from cd63888 to 101e286 Compare July 18, 2026 06:10
@normanmaurer
normanmaurer merged commit 3caae46 into 4.1 Jul 18, 2026
18 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17093-to-4.1 branch July 18, 2026 06:15
@chrisvest chrisvest added this to the 4.1.137.Final milestone Jul 22, 2026
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
…tty#17095)

Auto-port of netty#17093 to 4.1
Cherry-picked commit: 010b6e8

---
Motivation:

The valid range of `maxOrder` is 0 to 14, but negative values were
accepted because only the upper bound was validated. When configured
through `io.netty.allocator.maxOrder`, a negative value may result in an
invalid chunk size during static initialization.

Modification:

Validate the lower bound of `maxOrder` and add a regression test.

Result:

Negative `maxOrder` values are rejected with an
`IllegalArgumentException`.

Co-authored-by: CoderBruis <[email protected]>
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.

4 participants