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

use null terminated string for userinfo #591

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

NesterovichAlexey
Copy link
Contributor

userInfoCString could be a non-null terminated string, and then strdup is called in the code and it sometimes crashes with the Heap buffer overflow error.

I wrote a unit test. Before the fix, ~2% of 10,000 runs failed. After the fix, there were no failures.

Copy link
Collaborator

@bamx23 bamx23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bamx23 bamx23 merged commit 3e90345 into kstenerud:master Nov 11, 2024
21 checks passed
@NesterovichAlexey NesterovichAlexey deleted the set-user-info branch November 11, 2024 20:51
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.

3 participants