From 65f486ff020a14e88f6d389935cacebfefe7d003 Mon Sep 17 00:00:00 2001 From: Aron Fischer Date: Thu, 22 Dec 2016 00:32:08 +0100 Subject: [PATCH] swarm/api: check for zero length manifest error (#3468) --- swarm/api/manifest.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index a289c01f96..d6dc24c486 100644 --- a/swarm/api/manifest.go +++ b/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 {