Skip to content

Enforce VecM max length on serde deserialize - #598

Merged
leighmcculloch merged 1 commit into
mainfrom
vecm-serde-enforce-max
Sep 29, 2026
Merged

leighmcculloch merged 1 commit into
mainfrom
vecm-serde-enforce-max

Conversation

@leighmcculloch

Copy link
Copy Markdown
Member

Note

A replay of #594 that was released in v28.0.1 onto main.
Cherry picked from commit ced6bd3.

What

Deserialize VecM through its existing TryFrom<Vec<T>>.

Why

So serde rejects arrays longer than MAX. The derived Deserialize ignored MAX, letting JSON decodes accept oversized arrays and emit invalid XDR.

Close #593

Copilot AI lite review requested due to automatic review settings September 29, 2026 01:43
@leighmcculloch leighmcculloch changed the title enforce VecM max length on serde deserialize (#594) Enforce VecM max length on serde deserialize Sep 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

This PR enforces VecM maximum lengths during serde deserialization, preventing oversized arrays from producing invalid XDR.

Changes:

  • Deserialize through TryFrom<Vec<T>>.
  • Regenerate shared output.
  • Add boundary and rejection tests.
File Description
xdr-generator-rust/​generator/​header.rs Updates bounded serde deserialization.
src/​generated.rs Reflects the generated VecM change.
src/​tests/​serde.rs Tests maximum-length enforcement.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@leighmcculloch
leighmcculloch added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit a7018f6 Sep 29, 2026
407 checks passed
@leighmcculloch
leighmcculloch deleted the vecm-serde-enforce-max branch September 29, 2026 01:52
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.

stellar-xdr encode emits XDR that stellar-xdr decode rejects when a JSON array exceeds its max length

3 participants