-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Heap buffer overflow with in situ parsing #1723
Comments
For SIMD version, I think it is needed to add padding to the source string. |
Is there a way to know how much? Just adding 4 or 8 bytes doesn't seem to always work, there'll just be another example that goes wrong. |
Currently RapidJSON supports up to SSE 4.1, 16 bytes alignment should be sufficient. |
Though it doesn't show in this minimal example, having to add padding to the buffers I get from my network library would add an extra memory allocation, negating the gain from using SSE 4 instructions. I'll just disable them for now. |
The following program causes a heap buffer overflow, sometimes a segfault:
Compile with
g++ -fsanitize=address -g3 -mavx -I rapidjson/include test.cpp
Address sanitizer output:
The text was updated successfully, but these errors were encountered: