From 1d55bf7466679bfd1ce30166d48fef52346f005d Mon Sep 17 00:00:00 2001 From: Josh Hawn Date: Mon, 2 Mar 2015 17:40:10 -0800 Subject: [PATCH] Check for error when copying v2 image blob to temp The call to io.Copy was not being checked for errors at a critical point in the pull logic. This patch will log the error value if not nil. Docker-DCO-1.1-Signed-off-by: Josh Hawn (github: jlhawn) Upstream-commit: 6564e0ad2f63257458a5bad68f47504223b00285 Component: engine --- components/engine/graph/pull.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/engine/graph/pull.go b/components/engine/graph/pull.go index bbf887fb75..27830f64e3 100644 --- a/components/engine/graph/pull.go +++ b/components/engine/graph/pull.go @@ -496,7 +496,9 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri return fmt.Errorf("unable to wrap image blob reader with TarSum: %s", err) } - io.Copy(tmpFile, utils.ProgressReader(ioutil.NopCloser(tarSumReader), int(l), out, sf, false, common.TruncateID(img.ID), "Downloading")) + if _, err := io.Copy(tmpFile, utils.ProgressReader(ioutil.NopCloser(tarSumReader), int(l), out, sf, false, common.TruncateID(img.ID), "Downloading")); err != nil { + return fmt.Errorf("unable to copy v2 image blob data: %s", err) + } out.Write(sf.FormatProgress(common.TruncateID(img.ID), "Verifying Checksum", nil))