-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Fix buffer overlow in case method docstring #1615
Conversation
Prior to this commit the `add_docstring` function had a buffer overlow issue that was causing memory to be clobbered. This commit changes the `add_docstring` function to use a `printbuf` to accumulate the string ensuring no more buffer overflow issues. Fixes ponylang#1609
@dipinhora Yep, this solves the issue - sorry to assume that your hashmap implementation had to be the source of the problems - I guess the memory issue here was spilling over into the memory of the hashmap and causing the assert failures there. Thanks so much for figuring it out! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge when CI passes.
@dipinhora mea culpa; I wrote that function. Can you point out the buffer overflow to me for my re-education, please? |
@jemc No problem. It took me many hours split across multiple days until I finally got lucky and figured out the real issue (which I only discovered because I switched to using |
@kulibali No problem. It happens. The following is what I understand to be occurring in the old code:
In the process of rewriting the logic for |
Thanks! I should have noticed the use of |
Thanks again! |
Prior to this commit the
add_docstring
function had abuffer overlow issue that was causing memory to be
clobbered.
This commit changes the
add_docstring
function touse a
printbuf
to accumulate the string ensuringno more buffer overflow issues.
Fixes #1609