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

Decode tree bug: incomplete reads break the decoding process #64

Merged
merged 2 commits into from
Aug 9, 2016
Merged

Decode tree bug: incomplete reads break the decoding process #64

merged 2 commits into from
Aug 9, 2016

Conversation

alcortesm
Copy link
Contributor

There is a bug in the implementation of Tree.Decode, when reading the hash from the object, we are
not checking the return value of read.

When read reads less bytes than what we asked for (a not very common event), decoding the object fails.

This patch adds a test to force the situation (through a mock Object reader) and a fix.

@codecov-io
Copy link

Current coverage is 65.48% (diff: 0.00%)

Merging #64 into master will decrease coverage by 0.01%

@@             master        #64   diff @@
==========================================
  Files            45         45          
  Lines          2530       2529     -1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits           1657       1656     -1   
  Misses          698        698          
  Partials        175        175          

Powered by Codecov. Last update 674e784...538da1d

@mcuadros mcuadros merged commit da2682b into src-d:master Aug 9, 2016
@alcortesm alcortesm deleted the fix-tree-decode-bug branch August 10, 2016 07:23
mcuadros pushed a commit that referenced this pull request Jan 31, 2017
* Add test that fails for incomplete reads from an object

* Fix imcomplete reads
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants