swarm/api: check for zero length manifest error (#3468)

release/1.5
Aron Fischer 8 years ago committed by Felix Lange
parent df096a7771
commit 65f486ff02
  1. 5
      swarm/api/manifest.go

@ -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 {

Loading…
Cancel
Save