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

Improve robustness of INI parser by refusing NULL characters #98

Open
bubnikv opened this issue May 4, 2022 · 1 comment
Open

Improve robustness of INI parser by refusing NULL characters #98

bubnikv opened this issue May 4, 2022 · 1 comment

Comments

@bubnikv
Copy link

bubnikv commented May 4, 2022

We are facing a weird issue on Windows, where a file move operation is not atomic: It seems to copy the file and sometimes it produces files that start normally, but then end filled with NULL characters. It looks as if a buffer was prepared, possibly memory mapped and then never filled.

Unfortunately the property_tree ini parser parses such files in many cases. Would it be possible to throw an exception on NULL characters, possibly as an option? Other characters below ASCII 32 excluding CR, LF, TAB may possibly be refused as well.

@ashtum
Copy link
Collaborator

ashtum commented Nov 17, 2023

@bubnikv This appears to be an issue in your specific use-case. Changing the library's behavior to fix it might not be the right choice. Have you tried reading the file, applying the necessary filtration, and then passing an std::string to the parser?

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

No branches or pull requests

2 participants