Skip to content

fix: reject non-integer dynamic format arguments - #1332

Open
rksharma-owg wants to merge 1 commit into
google:masterfrom
rksharma-owg:codex/validate-dynamic-format-args
Open

fix: reject non-integer dynamic format arguments#1332
rksharma-owg wants to merge 1 commit into
google:masterfrom
rksharma-owg:codex/validate-dynamic-format-args

Conversation

@rksharma-owg

Copy link
Copy Markdown

Fixes #1331

std.format accepted non-integer values supplied through * field width and precision. Because those values flow into recursive padding and numeric formatting as if they were integers, malformed output could be produced instead of an error. Validate both dynamic arguments before formatting while preserving existing integer behavior.

Validation

  • JSONNET_BIN=../jsonnet ./test_suite/run_tests.sh (175 tests)
  • git diff --check

The issue also reports separate large-number conversion discrepancies; this focused change addresses the reproducible dynamic width/precision contract violation.

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.

std.format: wrong digits for %f/%d on large values; malformed output for non-integer * precision

1 participant