[lxc-devel] [distrobuilder/master] shared/net: Fix hash matching

monstermunchkin on Github lxc-bot at linuxcontainers.org
Thu Dec 20 20:00:08 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181220/2e1d0171/attachment.bin>
-------------- next part --------------
From 9f09f83c144abc1f08cf21de0490c6ce96809e8f Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Thu, 20 Dec 2018 20:59:34 +0100
Subject: [PATCH] shared/net: Fix hash matching

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 shared/net.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/shared/net.go b/shared/net.go
index a11e6c8..f887de8 100644
--- a/shared/net.go
+++ b/shared/net.go
@@ -43,6 +43,8 @@ func DownloadHash(file, checksum string, hashFunc hash.Hash) error {
 		defer image.Close()
 
 		if checksum != "" {
+			hashFunc.Reset()
+
 			_, err = io.Copy(hashFunc, image)
 			if err != nil {
 				return err


More information about the lxc-devel mailing list