diff options
author | Janoš Guljaš <janos@users.noreply.github.com> | 2018-08-07 21:34:33 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-08-07 21:34:33 +0800 |
commit | 00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284 (patch) | |
tree | 1b8f8266d15a53ba6868c0aef6e16e294c23ff6e /swarm/bmt/bmt.go | |
parent | 9df16f34689956121ebc360857f91242291b7f0c (diff) | |
download | go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.tar go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.tar.gz go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.tar.bz2 go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.tar.lz go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.tar.xz go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.tar.zst go-tangerine-00e6da9704b2cd7ddcc1cd31ed3f6bbaa8e1e284.zip |
swarm/bmt: ignore data longer then 4096 bytes in Hasher.Write (#17338)
Diffstat (limited to 'swarm/bmt/bmt.go')
-rw-r--r-- | swarm/bmt/bmt.go | 2 |
1 files changed, 1 insertions, 1 deletions
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() |