Skip to content

THRIFT-6050: Limit struct read/write recursion depth in Swift library#3555

Draft
Jens-G wants to merge 1 commit into
apache:masterfrom
Jens-G:swift-recursion-depth
Draft

THRIFT-6050: Limit struct read/write recursion depth in Swift library#3555
Jens-G wants to merge 1 commit into
apache:masterfrom
Jens-G:swift-recursion-depth

Conversation

@Jens-G
Copy link
Copy Markdown
Member

@Jens-G Jens-G commented May 28, 2026

Summary

  • Adds recursion depth counter to Swift TProtocol base
  • Limit is 64; throws TProtocolError with .depthLimit when exceeded
  • Swift generator wraps struct read/write with defer to guarantee decrement

Test plan

  • Unit tests in lib/swift/Tests/ verify depth allow/reject/restore

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Client: swift

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Jens-G Jens-G requested review from fishy and mhlakhani as code owners May 28, 2026 11:46
@Jens-G Jens-G marked this pull request as draft May 28, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant