Skip to content

fix(logs): respect printf length modifiers in params#1752

Merged
jpnurmi merged 5 commits into
masterfrom
jpnurmi/fix/log-args
May 27, 2026
Merged

fix(logs): respect printf length modifiers in params#1752
jpnurmi merged 5 commits into
masterfrom
jpnurmi/fix/log-args

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented May 25, 2026

Fix structured log parameter extraction to respect printf argument widths.

The previous parser always consumed integer variadic arguments as 64-bit values, even for default-width specifiers like %d and %u. On 32-bit platforms this can read adjacent stack data, desynchronize later arguments, and serialize leaked or corrupted values into log attributes.

This also consumes dynamic width and precision arguments so formats like %*d stay aligned with the underlying va_list.

Closes #1401 , part of #1398

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7ae8309. Configure here.

Comment thread src/sentry_logs.c Outdated
@jpnurmi jpnurmi requested review from JoshuaMoelans and mujacica May 27, 2026 07:58
Copy link
Copy Markdown
Member

@JoshuaMoelans JoshuaMoelans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, LGTM! 🚀

@jpnurmi jpnurmi merged commit 62cd8f9 into master May 27, 2026
64 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/fix/log-args branch May 27, 2026 08:55
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.

Structured Logs: follow up - length format specifier handling

2 participants