Fix BUFFER_OVERFLOW.SPRINTF in zos-remote-plugin.c#509
Merged
stevegrubb merged 1 commit intolinux-audit:masterfrom Feb 28, 2026
Merged
Fix BUFFER_OVERFLOW.SPRINTF in zos-remote-plugin.c#509stevegrubb merged 1 commit intolinux-audit:masterfrom
stevegrubb merged 1 commit intolinux-audit:masterfrom
Conversation
Replace sprintf with snprintf to prevent potential buffer overflow when formatting logString buffer. Svace report: Warning: An element of array '&logString[0]' of size 200 is accessed by an index with values in [0, +inf] which may lead to a buffer overflow. Format string: 'Linux (%s): type: %s'. Filled values can have unlimited string length. (CWE120, CWE121, CWE122, CWE124, CWE134, CWE20) Location: zos-remote-plugin.c:227 Co-authored-by: Z.AI GLM-5
Contributor
|
Thanks for the patch. Neither item being logged is attacker controlled. |
Contributor
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace sprintf with snprintf to prevent potential buffer overflow when formatting logString buffer.
Svace report:
Warning: An element of array '&logString[0]' of size 200 is accessed
by an index with values in [0, +inf] which may lead to a buffer overflow.
Format string: 'Linux (%s): type: %s'. Filled values can have unlimited
string length. (CWE120, CWE121, CWE122, CWE124, CWE134, CWE20)
Location: zos-remote-plugin.c:227