From 00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jano=C5=A1=20Gulja=C5=A1?= <janos@users.noreply.github.com>
Date: Tue, 7 Aug 2018 15:34:33 +0200
Subject: swarm/bmt: ignore data longer then 4096 bytes in Hasher.Write
 (#17338)

---
 swarm/bmt/bmt.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'swarm')

diff --git a/swarm/bmt/bmt.go b/swarm/bmt/bmt.go
index 1a141047a..97e0e141e 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()
-- 
cgit v1.2.3