Skip to content

unchecked::utf16to8 reads out of bounds if provided only leading surrogate #78

@jimon

Description

@jimon

In case if provided an array of a form [..., 0xd800u], then utf16to8 will try to read trailing surrogate without even checking if we went outside of the array. This leads the following while (start != end) to never stop until the code tries to read unmapped memory and segfaults.

I know that it's unchecked, but segfaulting on invalid input is a pretty grim failure mode :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions