Skip to content

Auto-port 4.1: Fix missing readable-bytes check in SmtpResponseDecoder - #17556

Merged
normanmaurer merged 1 commit into
4.1from
auto-port-pr-17516-to-4.1
Sep 20, 2026
Merged

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

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17516 to 4.1
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: 2343e79
▶️ Tests: 396775 executed
⚪️ Checks: 18/18 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer normanmaurer added this to the 4.1.139.Final milestone Sep 20, 2026
@normanmaurer
normanmaurer merged commit 0372b88 into 4.1 Sep 20, 2026
19 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17516-to-4.1 branch September 20, 2026 16:55
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
netty#17556)

Auto-port of netty#17516 to 4.1
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

Co-authored-by: Norman Maurer <[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.

2 participants