diff --git a/peer/control/ping.go b/peer/control/ping.go index 8d0826e..7ea0bf5 100644 --- a/peer/control/ping.go +++ b/peer/control/ping.go @@ -37,6 +37,8 @@ type Ping struct { // buf[:Size]. Taking the buffer lets callers reuse one across sends; every // field is written unconditionally so a reused buffer needs no pre-zeroing. func (p Ping) Marshal(buf []byte) []byte { + _ = buf[Size-1] // Panic if buffer is too small. + buf[0] = version binary.BigEndian.PutUint64(buf[1:9], uint64(p.PingTS)) if p.SrcV4.IsValid() {