From cf37ee4de4647076273e19ca2b496df4d53f2c8f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 12 Jun 2026 18:31:28 +0000 Subject: internal/format/packfile/delta: Add MaxChainDepth --- internal/format/packfile/delta/apply.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/format/packfile/delta/apply.go b/internal/format/packfile/delta/apply.go index d0918839..4210d1b3 100644 --- a/internal/format/packfile/delta/apply.go +++ b/internal/format/packfile/delta/apply.go @@ -6,6 +6,11 @@ import ( "lindenii.org/go/lgo/intconv" ) +// MaxChainDepth is the maximum supported delta chain length. +// Resolvers reject chains deeper than this +// to bound recursion depth and reconstruction work. +const MaxChainDepth = 1 << 12 + // Apply applies one inflated delta payload to base // and returns the reconstructed result. // -- cgit v1.3.1-10-gc9f91