diff options
Diffstat (limited to 'libgo/go/archive/tar/common.go')
-rw-r--r-- | libgo/go/archive/tar/common.go | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/libgo/go/archive/tar/common.go b/libgo/go/archive/tar/common.go index 2a1e4321826..d2ae66d554d 100644 --- a/libgo/go/archive/tar/common.go +++ b/libgo/go/archive/tar/common.go @@ -13,7 +13,6 @@ package tar import ( - "bytes" "errors" "fmt" "os" @@ -21,6 +20,10 @@ import ( "time" ) +// BUG: Use of the Uid and Gid fields in Header could overflow on 32-bit +// architectures. If a large value is encountered when decoding, the result +// stored in Header will be the truncated version. + // Header type flags. const ( TypeReg = '0' // regular file @@ -271,28 +274,6 @@ func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) { return h, nil } -func isASCII(s string) bool { - for _, c := range s { - if c >= 0x80 { - return false - } - } - return true -} - -func toASCII(s string) string { - if isASCII(s) { - return s - } - var buf bytes.Buffer - for _, c := range s { - if c < 0x80 { - buf.WriteByte(byte(c)) - } - } - return buf.String() -} - // isHeaderOnlyType checks if the given type flag is of the type that has no // data section even if a size is specified. func isHeaderOnlyType(flag byte) bool { |