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

DeJson string deserialization accepts various invalid JSON strings #11

Open
thomcc opened this issue Aug 8, 2020 · 0 comments
Open

Comments

@thomcc
Copy link
Contributor

thomcc commented Aug 8, 2020

After #10 lands, there are two issues with DeJson's string deserialization code:

  1. Various invalid escapes to get through. Any character that appears after a backslash is allowed more or less.
  2. Various ASCII control codes are allowed in JSON strings in unescaped form, but it should be an error if any below U+0020 appear without being escaped. (E.g.

    nanoserde/src/serde_json.rs

    Lines 517 to 519 in 0704316

    '\0' => {
    return Err(self.err_parse("string"));
    }
    and

    nanoserde/src/serde_json.rs

    Lines 524 to 526 in 0704316

    if self.cur == '\0' {
    return Err(self.err_parse("string"));
    }
    should be adjusted so that it's any character between ('\u{0}'..'\u{20}') that causes an error).

I don't really care a ton about either of these personally, though.

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

1 participant