aboutsummaryrefslogtreecommitdiff
path: root/internal/format
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-06-12 18:31:28 +0000
committerGravatar Runxi Yu2026-06-12 18:31:28 +0000
commitcf37ee4de4647076273e19ca2b496df4d53f2c8f (patch)
tree021aec150961221b6a2f25c0e8c143945b0ca544 /internal/format
parentinternal/format/pack{idx,rev}, object/store/packed: Update PackObjects invoca... (diff)
internal/format/packfile/delta: Add MaxChainDepth
Diffstat (limited to 'internal/format')
-rw-r--r--internal/format/packfile/delta/apply.go5
1 files changed, 5 insertions, 0 deletions
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.
//