Fix overflow exception when serializing by scc-tw · Pull Request #1746 · microsoft/cpprestsdk · GitHub
Skip to content

Fix overflow exception when serializing#1746

Open
scc-tw wants to merge 1 commit intomicrosoft:masterfrom
scc-tw:master
Open

Fix overflow exception when serializing#1746
scc-tw wants to merge 1 commit intomicrosoft:masterfrom
scc-tw:master

Conversation

@scc-tw
Copy link
Copy Markdown

@scc-tw scc-tw commented Mar 9, 2023

When the MSB of the initial wchar_t is set, the lowSurrogate would be inferred to be "unsigned".
The if statement would be triggered, and the exception "UTF-16 string has invalid low surrogate" would be thrown.

This needs to be fixed by making the type "signed" and then comparing it to the integer values of the specified constants.

@scc-tw
Copy link
Copy Markdown
Author

scc-tw commented Mar 9, 2023

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.

2 participants