]> Cypherpunks repositories - gostls13.git/commit
archive/tar: properly parse GNU base-256 encoding
authorJoe Tsai <joetsai@digital-static.net>
Wed, 2 Dec 2015 23:41:44 +0000 (15:41 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 4 Dec 2015 22:38:15 +0000 (22:38 +0000)
commit5ebb374f96da366d2c44b2fae7d9b3d0af7825dd
tree011709e8140abbe092e6da64da57da06ed8a61dd
parentc498a45b333695257099f4000ba9ca93803ee99e
archive/tar: properly parse GNU base-256 encoding

Motivation:
* Previous implementation did not detect integer overflow when
parsing a base-256 encoded field.
* Previous implementation did not treat the integer as a two's
complement value as specified by GNU.

The relevant GNU specification says:
<<<
GNU format uses two's-complement base-256 notation to store values
that do not fit into standard ustar range.
>>>

Fixes #12435

Change-Id: I4639bcffac8d12e1cb040b76bd05c9d7bc6c23a8
Reviewed-on: https://go-review.googlesource.com/17424
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/archive/tar/reader.go
src/archive/tar/reader_test.go