Skip to content

JSONSerialization: fix a crash when an escape sequence contains low-surrogate code point without the corresponding high-surrogate code point #1803

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

Merged
merged 1 commit into from
Dec 16, 2018

Conversation

broadwaylamb
Copy link
Contributor

@broadwaylamb broadwaylamb commented Dec 12, 2018

The triggering JSON:

[
  "\uDFF3"
]

I've also added some tests. However, I couldn't run them, because the test suite crashes on this line:
https://github.com/apple/swift-corelibs-foundation/blob/b5d216e2ef7299faed12f404654f1f514eb8138a/TestFoundation/HTTPServer.swift#L581
And I have no idea why, but pretty sure my fix has nothing to do with it.

(In fact, in order to build TestFoundation, I needed to dance around a bit, because the xdgTestHelper target requires Swift 3 compatibility mode, which is not supported in the latest development snaphsot that I've been using.)

@spevans
Copy link
Contributor

spevans commented Dec 12, 2018

@swift-ci test

@broadwaylamb broadwaylamb force-pushed the master branch 2 times, most recently from 08d08da to c1fae7b Compare December 13, 2018 10:34
@spevans
Copy link
Contributor

spevans commented Dec 13, 2018

@swift-ci test

@broadwaylamb
Copy link
Contributor Author

broadwaylamb commented Dec 14, 2018

@spevans can you please re-trigger the build? Seems like it's stuck.

@spevans
Copy link
Contributor

spevans commented Dec 14, 2018

@swift-ci test

@broadwaylamb
Copy link
Contributor Author

@jakepetroules is there anything else I can improve in this PR?

@jakepetroules
Copy link
Contributor

LGTM, but please have @itaiferber review as well.

@jakepetroules jakepetroules dismissed their stale review December 14, 2018 21:17

Passing off to Itai

Copy link
Contributor

@itaiferber itaiferber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me! If you want to change the CocoaError thing feel free, but otherwise I can merge

…urrogate code point without the corresponding high-surrogate code point
@itaiferber
Copy link
Contributor

@swift-ci Please test and merge

@spevans
Copy link
Contributor

spevans commented Dec 16, 2018

@swift-ci test and merge

@swift-ci swift-ci merged commit 101216e into swiftlang:master Dec 16, 2018
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.

5 participants