Skip to content

_escape function throws error for some binary strings and blobs #8

@betzrhodes

Description

@betzrhodes

_escape function throws error for some binary strings and blobs. The multi-byte unicode conditions do not check for string length before accessing multi-byte characters, so code tries to iterate past the end of the string.

#require "JSONEncoder.class.nut:2.0.0"

local binStr = "\xe8\x03\x00\x00\x01\x00\x00\xc0";
server.log(JSONEncoder.encode(binStr));

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