cleanup va_start/va_end and introduce vasprintf#826
Open
gottfriedleibniz wants to merge 2 commits intoSDL-Hercules-390:developfrom
Open
cleanup va_start/va_end and introduce vasprintf#826gottfriedleibniz wants to merge 2 commits intoSDL-Hercules-390:developfrom
gottfriedleibniz wants to merge 2 commits intoSDL-Hercules-390:developfrom
Conversation
- Missing va_end statements; - Incorrect va_copy ordering in BFR_VSNPRINTF; - Sanitize snprintf results or ensure buffer is initially \0'd.
Replace dynamic format string allocation (i.e., incrementing a buffer by a fixed amount until vsnprintf returns success) with vasprintf. Polyfill'ing for builds that do not include the GNU extension.
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.
Individual commit messages provide additional detail, but in general:
BFR_VSNPRINTFwith the more idiomaticvasprintf(a GNU extension, with a polyfill for build systems that do not support it) to avoid the current brute-force approach.