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

fix: crash on macos 13.0.1 #39

Merged
merged 1 commit into from
Nov 21, 2022
Merged

fix: crash on macos 13.0.1 #39

merged 1 commit into from
Nov 21, 2022

Conversation

burmecia
Copy link
Collaborator

This uninitialized pointer secret_buf caused crash when getline() is called on macOS 13.0.1. As the man page said:

If *lineptr is set to NULL before the call, then getline() will allocate a buffer for storing the line.

So it's better to always initialize pointer to NULL.

Copy link
Owner

@michelp michelp left a comment

Choose a reason for hiding this comment

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

Nice catch thank you!

@michelp michelp merged commit 8e49dde into michelp:main Nov 21, 2022
@burmecia burmecia deleted the fix/uninitialized-pointer branch November 21, 2022 23:23
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.

None yet

2 participants