Skip to content

fix: prevent endless CPU loops (decrypt failure, cyclic mDNS pointers) - #272

Open
ticaki wants to merge 1 commit into
Apollon77:mainfrom
ticaki:fix/endless-loops
Open

ticaki wants to merge 1 commit into
Apollon77:mainfrom
ticaki:fix/endless-loops

Conversation

@ticaki

@ticaki ticaki commented Nov 16, 2026

Copy link
Copy Markdown

Two synchronous endless loops that freeze the whole process at 100% CPU, with no logs. Both are running as a runtime patch in ioBroker.homekit-controller on a production system (same logic).

  • Decrypt failure (in production since 2026-06-07, current reject version since 2026-06-27): _requestEncrypted never advanced the frame buffer on a failed decrypt. It now closes the connection and rejects.
  • dnssd readFQDN (in production since 2026-06-27): dnssd 0.4.1 is unmaintained and follows compression pointers without a cycle guard, so [0xC0, 0x00] loops forever. The fix overrides readFQDN with a visited-pointer check and the 127-label limit. Includes a test.

Adapter PR, which removes its postinstall patcher once this is released: Apollon77/ioBroker.homekit-controller#483

🤖 Generated with Claude Code

…nters

- _requestEncrypted: on decrypt failure the frame buffer was never
  advanced, so the parser loop spun forever. Close the connection and
  reject instead.
- dnssd 0.4.1 readFQDN follows compression pointers without a cycle
  guard; a self-referencing pointer in an mDNS packet loops forever.
  Override it with a visited-pointer check and the 127-label limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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