Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
betzrhodes opened this issue Feb 12, 2019 · 1 comment
Open

Comments

@betzrhodes
Copy link

_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));
@smittytone
Copy link

See #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants