Repository navigation
Fix STATS format argument types - #275
Open
Jazzzzz-hub wants to merge 1 commit into
Open
Jazzzzz-hub wants to merge 1 commit into
Jazzzzz-hub wants to merge 1 commit into
Conversation
sendto_one() uses libc vsprintf, so %u requires unsigned int and %d requires int. Match the STATS l/L and STATS u arguments to those variadic format types while preserving the existing numeric formats and protocol output.
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.
sendto_one() currently resolves to libc vsprintf, so its variadic arguments must match the standard printf format types.
The STATS l/L paths use %u fields while passing a mixture of int, long, and time_t-derived values. STATS u similarly uses %d while passing time_t expressions.
On LP64 systems these are variadic type mismatches, even though small values may appear to print correctly.
This change:
casts the existing STATS l/L %u arguments to unsigned int
casts the STATS uptime %d arguments to int
keeps the existing numeric formats and wire output unchanged
does not change STATS authorization or visibility behavior
Verification performed:
m_stats.o compiled successfully
full Bahamut binary built successfully
tested STATS u, STATS l, and exact-client STATS L against baseline and patched localhost-only instances
baseline and patched responses retained the same protocol structure
no protocol format regression observed