Skip to content

Fix STATS format argument types - #275

Open
Jazzzzz-hub wants to merge 1 commit into
DALnet:masterfrom
Jazzzzz-hub:fix-stats-format-arguments
Open

Jazzzzz-hub wants to merge 1 commit into
DALnet:masterfrom
Jazzzzz-hub:fix-stats-format-arguments

Conversation

@Jazzzzz-hub

Copy link
Copy Markdown
Contributor

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

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.
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.

1 participant