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

Should validate UTF-8 multi-byte validity for short decode path too #239

Closed
cowtowncoder opened this issue Jan 30, 2021 · 1 comment
Closed
Labels
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: follow-up to #236)

Looks like "long / slow" decoding path for UTF-8 Strings checks that multi-byte characters do not invalid encoding patterns, as expected (and what JSON parser does), but the quick/short pass (when String value is guaranteed to fit in buffer without bounds checks) does not necessarily similarly verify that -- the first byte is checked as expected, but 2nd - 4th are not. Check should be performed for these cases as well, and we should have basic tests as well.

I also think that since this may uncover existing invalid usage, change should go in 2.13 and not in 2.12 patch: that way we can get bit more testing.

@cowtowncoder
Copy link
Member Author

Methods to check in CBORParser:

  • _finishShortText(): short String values
  • _decodeShortName(): short property names

@cowtowncoder cowtowncoder added this to the 2.13.0 milestone Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant