Skip to content
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

Crash with bad unicode escape sequence #137

Closed
michalmuskala opened this issue Jun 14, 2017 · 2 comments
Closed

Crash with bad unicode escape sequence #137

michalmuskala opened this issue Jun 14, 2017 · 2 comments

Comments

@michalmuskala
Copy link

When the Unicode escape is 3 instead of 4 characters a crash occurs.

Poison.decode("\"\\u123\"")
** (ArgumentError) argument error
    :erlang.binary_to_integer("123\"", 16)
    (poison) lib/poison/parser.ex:250: Poison.Parser.string_escape/3
    (poison) lib/poison/parser.ex:37: Poison.Parser.parse/2
    (poison) lib/poison.ex:69: Poison.decode/2

Poison version 3.1.0
Elixir version: 1.5.0-dev (3f1e2224c)
Erlang/OTP: 20.0-rc.2

@ericmj
Copy link

ericmj commented Jun 14, 2017

This is fixed on master:

iex(1)> Poison.decode("\"\\u123\"")
{:error, %Poison.ParseError{pos: 7, rest: nil, value: "\\u123\""}}

@michalmuskala
Copy link
Author

Oh, perfect. It's good to close, then.

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