• Joe Tsai's avatar
    archive/tar: reapply Header.Size to regFileReader after merging · 0b84a64d
    Joe Tsai authored
    The use of PAX headers can modify the overall file size, thus the
    formerly created regFileReader may be stale.
    
    The relevant PAX specification for this behavior is:
    <<<
    Any fields in the preceding optional extended header shall override
    the associated fields in this header block for this file.
    >>>
    Where "optional extended header" refers to the preceding PAX header.
    Where "this header block" refers to the subsequent USTAR header.
    
    Fixes #15573
    Fixes #15564
    
    Change-Id: I83b1c3f05a9ca2d3be38647425ad21a9fe450ee2
    Reviewed-on: https://go-review.googlesource.com/28418Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    0b84a64d
reader.go 28 KB