Skip to content

Commit

Permalink
swarm/api: check for zero length manifest error (ethereum#3468)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aron Fischer authored and fjl committed Dec 21, 2016
1 parent df096a7 commit 65f486f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions swarm/api/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func readManifest(manifestReader storage.LazySectionReader, hash storage.Key, dp

// TODO check size for oversized manifests
size, err := manifestReader.Size(quitC)
if err != nil { // size == 0
// can't determine size means we don't have the root chunk
err = fmt.Errorf("Manifest not Found")
return
}
manifestData := make([]byte, size)
read, err := manifestReader.Read(manifestData)
if int64(read) < size {
Expand Down

0 comments on commit 65f486f

Please sign in to comment.