Skip to content

Tighten UTF-8 validation in read_string #79

@peter-jerry-ye

Description

@peter-jerry-ye

read_string accepts invalid UTF-8 (e.g., invalid continuation bytes, overlong sequences, surrogate range, or > U+10FFFF) and feeds them to unsafe_to_char.

Suggested fix: validate UTF-8 properly and raise InvalidString on malformed sequences. Mirror in async paths.

Refs: lib/reader.mbt, lib/async_reader.mbt.

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