From 50d066befb63f894cdaee7c2003e79bb901fe1c1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Wed, 15 Feb 2017 15:19:28 +0100 Subject: [PATCH] restore: Make sure buffer is large enough --- src/restic/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/restic/node.go b/src/restic/node.go index 253a33e9a..5349b5494 100644 --- a/src/restic/node.go +++ b/src/restic/node.go @@ -215,7 +215,7 @@ func (node Node) createFileAt(path string, repo Repository, idx *HardlinkIndex) } buf = buf[:cap(buf)] - if uint(len(buf)) < size { + if len(buf) < CiphertextLength(int(size)) { buf = NewBlobBuffer(int(size)) }