From ad0cf146e8f18fd6df988cff5b4e8de6eb4f0d24 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 22 Jun 2020 15:14:34 +0300 Subject: [PATCH] consensus: restrict invocation script size --- pkg/consensus/recovery_message.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/consensus/recovery_message.go b/pkg/consensus/recovery_message.go index af66daf7a..aa409b19a 100644 --- a/pkg/consensus/recovery_message.go +++ b/pkg/consensus/recovery_message.go @@ -97,7 +97,7 @@ func (p *changeViewCompact) DecodeBinary(r *io.BinReader) { p.ValidatorIndex = r.ReadU16LE() p.OriginalViewNumber = r.ReadB() p.Timestamp = r.ReadU32LE() - p.InvocationScript = r.ReadVarBytes() + p.InvocationScript = r.ReadVarBytes(1024) } // EncodeBinary implements io.Serializable interface. @@ -114,7 +114,7 @@ func (p *commitCompact) DecodeBinary(r *io.BinReader) { p.ValidatorIndex = r.ReadU16LE() r.ReadBytes(p.Signature[:]) r.ReadBytes(p.StateSignature[:]) - p.InvocationScript = r.ReadVarBytes() + p.InvocationScript = r.ReadVarBytes(1024) } // EncodeBinary implements io.Serializable interface. @@ -129,7 +129,7 @@ func (p *commitCompact) EncodeBinary(w *io.BinWriter) { // DecodeBinary implements io.Serializable interface. func (p *preparationCompact) DecodeBinary(r *io.BinReader) { p.ValidatorIndex = r.ReadU16LE() - p.InvocationScript = r.ReadVarBytes() + p.InvocationScript = r.ReadVarBytes(1024) } // EncodeBinary implements io.Serializable interface.