diff options
author | Aron Fischer <github@aron.guru> | 2016-12-22 07:32:08 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2016-12-22 07:32:08 +0800 |
commit | 65f486ff020a14e88f6d389935cacebfefe7d003 (patch) | |
tree | c0144f0cf7f8b3a4f135eaee447a9ae43dda2d05 | |
parent | df096a7771f28b9390463004eeb98eb2aebfd90e (diff) | |
download | go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.tar go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.tar.gz go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.tar.bz2 go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.tar.lz go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.tar.xz go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.tar.zst go-tangerine-65f486ff020a14e88f6d389935cacebfefe7d003.zip |
swarm/api: check for zero length manifest error (#3468)
-rw-r--r-- | swarm/api/manifest.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index a289c01f9..d6dc24c48 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 { |