aboutsummaryrefslogtreecommitdiff
path: root/src/archive/tar/format.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive/tar/format.go')
-rw-r--r--src/archive/tar/format.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/archive/tar/format.go b/src/archive/tar/format.go
index 9954b4d9f5..32e58a9d9b 100644
--- a/src/archive/tar/format.go
+++ b/src/archive/tar/format.go
@@ -147,6 +147,12 @@ const (
// Max length of a special file (PAX header, GNU long name or link).
// This matches the limit used by libarchive.
maxSpecialFileSize = 1 << 20
+
+ // Maximum number of sparse file entries.
+ // We should never actually hit this limit
+ // (every sparse encoding will first be limited by maxSpecialFileSize),
+ // but this adds an additional layer of defense.
+ maxSparseFileEntries = 1 << 20
)
// blockPadding computes the number of bytes needed to pad offset up to the