• Joe Tsai's avatar
    archive/tar: validate sparse headers in parsePAX · 3d4ea227
    Joe Tsai authored
    According to the GNU manual, the format is:
    <<<
    GNU.sparse.size=size
    GNU.sparse.numblocks=numblocks
    repeat numblocks times
      GNU.sparse.offset=offset
      GNU.sparse.numbytes=numbytes
    end repeat
    >>>
    
    The logic in parsePAX converts the repeating sequence of
    (offset, numbytes) pairs (which is not PAX compliant) into a single
    comma-delimited list of numbers (which is now PAX compliant).
    
    Thus, we validate the following:
    * The (offset, numbytes) headers must come in the correct order.
    * The ',' delimiter cannot appear in the value.
    We do not validate that the value is a parsible decimal since that
    will be determined later.
    
    Change-Id: I8d6681021734eb997898227ae8603efb1e17c0c8
    Reviewed-on: https://go-review.googlesource.com/31439
    Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    3d4ea227
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...