Skip to content

UTF-8 code makes assumptions about buffer size #464

@lionkor

Description

@lionkor

https://github.com/quickjs-ng/quickjs/blob/master/cutils.c#L247 makes the assumption that the buffer is always at least UTF8_CHAR_LEN_MAX, this is not checked. re_parse_group_name then calls it with a buffer, the size of which is also not checked. This results in a dependency on the buffer supplied to this function that the buffer is at least UTF8_CHAR_LEN_MAX.

I would consider this a soon-to-be-bug at best. I understand that error handling is difficult, but an assert would make sense here at the very least.

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