1
0
Fork 1
mirror of https://github.com/vbatts/tar-split.git synced 2025-07-04 15:28:29 +00:00

archive/tar: add missing error checks

Check for errors when reading the headers following the pax headers.

Fixes #11169.

Change-Id: Ifec4a949ec8df8b49fa7cb7a67eb826fe2282ad8
Reviewed-on: https://go-review.googlesource.com/11031
Reviewed-by: Russ Cox <rsc@golang.org>

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Michael Gehring 2015-06-13 10:53:06 +02:00 committed by Vincent Batts
parent 69de764807
commit 2e5698249c
3 changed files with 21 additions and 0 deletions

View file

@ -138,7 +138,13 @@ func (tr *Reader) Next() (*Header, error) {
// We actually read the whole file,
// but this skips alignment padding
tr.skipUnread()
if tr.err != nil {
return nil, tr.err
}
hdr = tr.readHeader()
if hdr == nil {
return nil, tr.err
}
mergePAX(hdr, headers)
// Check for a PAX format sparse file