Skip to content

Multibyte tidy_bytes accepts malformed UTF-8 sequences and miscomputes boundaries #1680

Open

Description

@OskarEichler

Problem

The multibyte byte-tidying path accepts invalid or truncated UTF-8 sequences and advances using byte patterns without validating continuation bytes and codepoint bounds. Malformed input can be preserved or consume neighboring bytes incorrectly.

Prepared commit d6578be887c4487342d20461237af2aede98cd22 validates sequence lengths, continuation bytes, overlong/surrogate/out-of-range codepoints and preserves valid boundary behavior.

External exhaustive boundary models pass on both Rubies. The unchanged 1,837-example suite, package and Action Mailer integration also pass.

CONTRIBUTING requires regression specs, so this report does not open a source-only PR or modify tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions