Skip to content

THRIFT-6048: Limit struct read/write recursion depth in Perl library#3553

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

THRIFT-6048: Limit struct read/write recursion depth in Perl library#3553
Jens-G wants to merge 1 commit into
apache:masterfrom
Jens-G:perl-recursion-depth

Conversation

@Jens-G
Copy link
Copy Markdown
Member

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

Summary

  • Adds incrementRecursionDepth / decrementRecursionDepth methods to Thrift::Protocol
  • Limit is DEFAULT_RECURSION_DEPTH (64); throws Thrift::TProtocolException on excess
  • Perl generator wraps struct read / write with eval/die-safe guard to restore counter

Test plan

  • lib/perl/t/recursion_depth.t — 5 TAP tests covering allow/reject/restore

🤖 Generated with Claude Code

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

Client: perl

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