Skip to content

Guard malformed compressed packets#27

Closed
vexdev wants to merge 1 commit into
mainfrom
codex/issue-102-decompress-guard
Closed

Guard malformed compressed packets#27
vexdev wants to merge 1 commit into
mainfrom
codex/issue-102-decompress-guard

Conversation

@vexdev

@vexdev vexdev commented May 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • guard PacketParser.decompressPayload against malformed compressed payloads that never make progress
  • reject compressed packets that require more input or a preset dictionary instead of spinning forever
  • add a regression test covering a malformed compressed EC packet

Root Cause

Inflater.inflate() can return 0 without setting finished() when the compressed payload is malformed or truncated. The previous loop treated that as normal progress and kept iterating forever, which can pin a CPU core and hold the aMule socket lock indefinitely.

Validation

  • ./gradlew test --tests jamule.ec.packet.PacketParserTest -Pkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process

@vexdev vexdev changed the title [codex] Guard malformed compressed packets Guard malformed compressed packets May 6, 2026
@vexdev vexdev closed this May 6, 2026
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.

1 participant