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

APPEND: avoid overrunning the buffer #161

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Conversation

dottedmag
Copy link
Contributor

if two APPENDs are called one after another, and first of them cannot fit the message into the buffer, the second will end up writing its message pass the end of the buffer (due to size parameter to snprintf being unsigned).

if two APPENDs are called one after another, and first of them
cannot fit the message into the buffer, the second will end up
writing its message pass the end of the buffer (due to size
parameter to snprintf being unsigned).
@dottedmag
Copy link
Contributor Author

I'm not entirely sure the checks are needed in all the APPEND variants.

Copy link
Owner

@jart jart left a comment

Choose a reason for hiding this comment

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

Thanks!

@jart jart merged commit 46d82a0 into jart:master Dec 11, 2023
1 check passed
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.

2 participants