Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 92648fe

Browse files
alcortesmmcuadros
authored andcommitted
Decode tree bug: incomplete reads break the decoding process (#64)
* Add test that fails for incomplete reads from an object * Fix imcomplete reads
1 parent 61c5306 commit 92648fe

File tree

2 files changed

+1207
-2
lines changed

2 files changed

+1207
-2
lines changed

tree.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ func (t *Tree) Decode(o core.Object) (err error) {
178178
}
179179

180180
var hash core.Hash
181-
_, err = r.Read(hash[:])
182-
if err != nil && err != io.EOF {
181+
if _, err = io.ReadFull(r, hash[:]); err != nil {
183182
return err
184183
}
185184

0 commit comments

Comments
 (0)