We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9c08c7 commit 67f9fb9Copy full SHA for 67f9fb9
internal/tgz/tgz.go
@@ -3,8 +3,10 @@ package tgz
3
import (
4
"archive/tar"
5
"compress/gzip"
6
+ "errors"
7
"fmt"
8
"io"
9
+ "math"
10
"os"
11
12
"github.com/go-git/go-billy/v5"
@@ -59,6 +61,9 @@ func unTar(fs billy.Filesystem, src *tar.Reader) error {
59
61
}
60
62
63
dst := header.Name
64
+ if header.Mode > math.MaxUint32 || header.Mode < 0 {
65
+ return errors.New("cannot use header mode as filemode")
66
+ }
67
mode := os.FileMode(header.Mode)
68
switch header.Typeflag {
69
case tar.TypeDir:
0 commit comments