From ead220898a918924c6f3929e413b4704907183a5 Mon Sep 17 00:00:00 2001 From: Janos Guljas Date: Tue, 7 Aug 2018 14:17:52 +0200 Subject: [PATCH] swarm/bmt: ignore data longer then 4096 bytes in Hasher.Write --- swarm/bmt/bmt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swarm/bmt/bmt.go b/swarm/bmt/bmt.go index 1a141047ae..97e0e141ed 100644 --- a/swarm/bmt/bmt.go +++ b/swarm/bmt/bmt.go @@ -318,7 +318,7 @@ func (h *Hasher) Sum(b []byte) (s []byte) { // with every full segment calls writeSection in a go routine func (h *Hasher) Write(b []byte) (int, error) { l := len(b) - if l == 0 { + if l == 0 || l > 4096 { return 0, nil } t := h.getTree()