Skip to content
Snippets Groups Projects
Commit 1303b939 authored by capossele's avatar capossele
Browse files

:bug: adds len check

parent a87ab206
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ import (
"github.com/iotaledger/goshimmer/packages/binary/drng"
"github.com/iotaledger/goshimmer/packages/binary/drng/payload"
"github.com/iotaledger/goshimmer/packages/binary/drng/payload/header"
"github.com/iotaledger/goshimmer/packages/binary/drng/state"
cbPayload "github.com/iotaledger/goshimmer/packages/binary/drng/subtypes/collectiveBeacon/payload"
"github.com/iotaledger/goshimmer/packages/binary/messagelayer/message"
......@@ -68,6 +69,9 @@ func configureEvents() {
cachedMessageMetadata.Release()
cachedMessage.Consume(func(msg *message.Message) {
if len(msg.Payload().Bytes()) < header.Length {
return
}
marshalUtil := marshalutil.New(msg.Payload().Bytes())
parsedPayload, err := payload.Parse(marshalUtil)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment