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

dump_escaped possible error ? #1589

Closed
noxytrux opened this issue Apr 29, 2019 · 2 comments
Closed

dump_escaped possible error ? #1589

noxytrux opened this issue Apr 29, 2019 · 2 comments
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@noxytrux
Copy link

noxytrux commented Apr 29, 2019

I'm looking at dump_escaped implementation and i'm concerned about uint32_t codepoint variable it is not initialized with any value whatsoever. So imo in release it should contain garbage which then will be processed in decode method.

I'm right or just touchy ?

https://github.com/nlohmann/json/blob/develop/include/nlohmann/detail/output/serializer.hpp#L304

@nickaein
Copy link
Contributor

I seems that codepoint is passed by referenced to decode() and will be assigned there.

@noxytrux
Copy link
Author

Ah yes, you are right because of state being always UTF8_ACCEPT at start it will init codepoint with static_cast<uint32_t>(0xff >> type) & (byte);

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants