+6
src/extract.go
+6
src/extract.go
···
9
9
"errors"
10
10
"fmt"
11
11
"io"
12
+
"math"
12
13
"os"
13
14
"strings"
14
15
···
174
175
// Detect and defuse zipbombs.
175
176
var totalSize uint64
176
177
for _, file := range archive.File {
178
+
if totalSize+file.UncompressedSize64 < totalSize {
179
+
// Would overflow
180
+
totalSize = math.MaxUint64
181
+
break
182
+
}
177
183
totalSize += file.UncompressedSize64
178
184
}
179
185
if totalSize > config.Limits.MaxSiteSize.Bytes() {