Skip to content

Auto-port 5.0: Fix missing readable-bytes check in SmtpResponseDecoder - #17557

Merged
normanmaurer merged 2 commits into
5.0from
auto-port-pr-17516-to-5.0
Sep 21, 2026
Merged

normanmaurer merged 2 commits into
5.0from
auto-port-pr-17516-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17516 to 5.0
Cherry-picked commit: 91a8497


Motivation:

decode() only checked for 3 readable bytes before parsing, but it
unconditionally consumes a 3-byte code plus a 4th separator byte. A
line consisting of only a 3-digit code (e.g. "250\r\n") passed the
guard and then threw a raw IndexOutOfBoundsException from readByte()
instead of the intended DecoderException.

Modifications:

Require 4 readable bytes and add a regression test.

Result:

No more IOOBE

Motivation:

decode() only checked for 3 readable bytes before parsing, but it
unconditionally consumes a 3-byte code plus a 4th separator byte. A
line consisting of only a 3-digit code (e.g. "250\r\n") passed the
guard and then threw a raw IndexOutOfBoundsException from readByte()
instead of the intended DecoderException.

Modifications:

Require 4 readable bytes and add a regression test.

Result:

No more IOOBE

(cherry picked from commit 91a8497)
@testlens-app

testlens-app Bot commented Sep 20, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: cb99736
▶️ Tests: 229376 executed
⚪️ Checks: 12/12 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Sep 21, 2026
@normanmaurer
normanmaurer merged commit f3760bc into 5.0 Sep 21, 2026
13 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17516-to-5.0 branch September 21, 2026 07:14
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