consensus: restrict invocation script size

This commit is contained in:
Evgenii Stratonikov 2020-06-22 15:14:34 +03:00
parent 511d18d409
commit ad0cf146e8

View file

@ -97,7 +97,7 @@ func (p *changeViewCompact) DecodeBinary(r *io.BinReader) {
p.ValidatorIndex = r.ReadU16LE() p.ValidatorIndex = r.ReadU16LE()
p.OriginalViewNumber = r.ReadB() p.OriginalViewNumber = r.ReadB()
p.Timestamp = r.ReadU32LE() p.Timestamp = r.ReadU32LE()
p.InvocationScript = r.ReadVarBytes() p.InvocationScript = r.ReadVarBytes(1024)
} }
// EncodeBinary implements io.Serializable interface. // EncodeBinary implements io.Serializable interface.
@ -114,7 +114,7 @@ func (p *commitCompact) DecodeBinary(r *io.BinReader) {
p.ValidatorIndex = r.ReadU16LE() p.ValidatorIndex = r.ReadU16LE()
r.ReadBytes(p.Signature[:]) r.ReadBytes(p.Signature[:])
r.ReadBytes(p.StateSignature[:]) r.ReadBytes(p.StateSignature[:])
p.InvocationScript = r.ReadVarBytes() p.InvocationScript = r.ReadVarBytes(1024)
} }
// EncodeBinary implements io.Serializable interface. // EncodeBinary implements io.Serializable interface.
@ -129,7 +129,7 @@ func (p *commitCompact) EncodeBinary(w *io.BinWriter) {
// DecodeBinary implements io.Serializable interface. // DecodeBinary implements io.Serializable interface.
func (p *preparationCompact) DecodeBinary(r *io.BinReader) { func (p *preparationCompact) DecodeBinary(r *io.BinReader) {
p.ValidatorIndex = r.ReadU16LE() p.ValidatorIndex = r.ReadU16LE()
p.InvocationScript = r.ReadVarBytes() p.InvocationScript = r.ReadVarBytes(1024)
} }
// EncodeBinary implements io.Serializable interface. // EncodeBinary implements io.Serializable interface.