apache / apache/rocketmq

RemotingCommand.decode throws unchecked exceptions for malformed frame headers

Open
#10,832 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

RemotingCommand.decode reads the header marker without checking that four bytes are available and passes an unknown serialize-type code into headerDecode. Malformed frames can therefore raise IndexOutOfBoundsException or NullPointerException instead of RemotingCommandException. Expected behavior: reject short frames and unknown serialize types with a controlled decode error.

Contributor guide

Open the contributing guide

Research direction

Start by locating RemotingCommand.decode and tracing its headerDecode call and existing decode-error handling. Reproduce inputs with fewer than four header bytes and with an unknown serialize-type code; done means both malformed frames produce RemotingCommandException rather than unchecked exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.