Skip to content

Sanitize controller names to prevent Qt rendering crashes#1768

Open
redaphid wants to merge 1 commit intomoonlight-stream:masterfrom
redaphid:fix-controller-name-sanitization
Open

Sanitize controller names to prevent Qt rendering crashes#1768
redaphid wants to merge 1 commit intomoonlight-stream:masterfrom
redaphid:fix-controller-name-sanitization

Conversation

@redaphid
Copy link
Copy Markdown

Summary

  • Sanitizes controller names to prevent Qt text rendering crashes
  • Removes control characters, null bytes, and invalid UTF-8 sequences
  • Limits controller name length to 128 characters

Background

Controllers with invalid UTF-8 sequences or control characters in their names can cause Qt's text rendering engine to crash when displaying unmapped gamepads. This adds defensive sanitization to ensure all controller names are safe to display.

Test plan

  • Test with controllers that have unusual characters in their names
  • Verify unmapped gamepad dialog displays correctly
  • Ensure no crashes occur with edge case controller names

🤖 Generated with Claude Code

Controllers with invalid UTF-8 sequences or control characters in their
names can cause Qt text rendering to crash. This fix sanitizes controller
names by removing control characters, null bytes, and limiting the length
to prevent crashes when displaying unmapped gamepads.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.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