浏览代码

swarm/bmt: ignore data longer then 4096 bytes in Hasher.Write (#17338)

Janoš Guljaš 7 年之前
父节点
当前提交
00e6da9704
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      swarm/bmt/bmt.go

+ 1 - 1
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()