RemotingCommand.decode throws unchecked exceptions for malformed frame headers
- 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
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