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

Fix parsing bad surrogate trailers #177

Closed

Conversation

brianmario
Copy link
Owner

@brianmario brianmario commented Nov 7, 2017

If a valid surrogate character escape is found and the following byte sequence isn't a valid unicode escape sequence, insert our replacement character '?' as we would any other place we saw invalid characters while unescaping.

In general, this default case from this switch should be treated as seeing an invalid character in the sequence. So we should replace it with our replacement character instead of blowing up.

This fix should be applied upstream on yajl itself as well, but I'm starting here since that's where the original issue was reported and we have a patched yajl embedded anyway.

Fixes #176

If a valid surrogate character escape is found, but the following
byte sequence isn't a valid unicode escape sequence, insert our
replacement character '?' as we would any other place we saw
invalid characters while unescaping.

Fixes #176
buffer left and have peeked ahead to see that a unicode escape
is approaching.

Thanks @kivikakk for helping me track down the actual bug here!
@brianmario
Copy link
Owner Author

Closing this as it's the wrong fix. Proper fix incoming.

@brianmario brianmario closed this Nov 7, 2017
@brianmario brianmario deleted the brianmario/fix-parsing-bad-surrogate-trailer branch November 7, 2017 05:52
@brianmario brianmario mentioned this pull request Nov 7, 2017
@brianmario
Copy link
Owner Author

Proper fix over at #178

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

Successfully merging this pull request may close these issues.

SIGABRT - process aborted
1 participant