Skip to content

Commit

Permalink
Merge pull request containers#2703 from nalind/copier-create-error
Browse files Browse the repository at this point in the history
copier.copierHandlerPut: don't check length when there are errors
  • Loading branch information
openshift-merge-robot authored Oct 20, 2020
2 parents a970ffb + b7c1c3d commit 9229549
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion copier/copier.go
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,9 @@ func copierHandlerPut(bulkReader io.Reader, req request, idMappings *idtools.IDM
case tar.TypeReg, tar.TypeRegA:
var written int64
written, err = createFile(path, tr)
if written != hdr.Size {
// only check the length if there wasn't an error, which we'll
// check along with errors for other types of entries
if err == nil && written != hdr.Size {
return errors.Errorf("copier: put: error creating %q: incorrect length (%d != %d)", path, written, hdr.Size)
}
case tar.TypeLink:
Expand Down

0 comments on commit 9229549

Please sign in to comment.