Skip to content

Three small fixes: uintmax_t format, include prefix pointer, redundant check - #442

Open
sobomax wants to merge 3 commits into
vstakhov:masterfrom
sippy:vendor-small-fixes
Open

sobomax wants to merge 3 commits into
vstakhov:masterfrom
sippy:vendor-small-fixes

Conversation

@sobomax

@sobomax sobomax commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Three independent one-line-ish fixes, each in its own commit:

  1. Fix format string for uintmax_t — ucl_msgpack_consume prints a (uintmax_t) value with %zu, which is wrong on 32-bit platforms; use %ju.
  2. Preserve mutable filename pointer when deriving include prefixes — keep the char * returned by basename() while stripping .conf/.ucl, instead of round-tripping through the const params->prefix; avoids discarded-qualifier diagnostics with const-preserving C library string functions.
  3. Remove redundant pointer check in ucl_parse_key — got_content is a non-NULL pointer that is already dereferenced there (CodeQL finding).

Built and ran the full test suite (21/21 pass) on current master.

Keep the mutable basename pointer when stripping .conf or .ucl from an
automatically generated include prefix. Searching through params->prefix
uses a const pointer, which can discard qualifiers on platforms where
the C library's string functions preserve the constness of their
argument.
got_content is a bool pointer that is always non-NULL and has already
been dereferenced; by this point *got_content is known to be true, so
the check is redundant (CodeQL).
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