Skip to content

libraries: Fix possible buffer/stack overflows in multiple libraries. #318

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

Merged
merged 1 commit into from
May 16, 2024

Conversation

iabdalkader
Copy link
Contributor

vsprintf should be avoided as it could easily overflow the buffer if the formatted string exceeds the max buffer size. vsnprintf, on the other hand, checks a buffer size argument. Note that they both null-terminate the string, so calling memset beforehand is not necessary.

`vsprintf` should be avoided as it could easily overflow the buffer if the formatted
string exceeds the max buffer size. `vsnprintf`, on the other hand, checks a buffer
size argument. Note that they both null-terminate the string, so calling `memset`
beforehand is not necessary.

Signed-off-by: iabdalkader <[email protected]>
@iabdalkader iabdalkader requested review from facchinm and pennam May 15, 2024 08:10
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels May 15, 2024
@iabdalkader iabdalkader merged commit 8d3bb27 into arduino:main May 16, 2024
6 of 7 checks passed
@iabdalkader iabdalkader deleted the vsprintf_buffer_overflows branch May 16, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants