reduced maximum rlpx enc handshake read to 2k

This commit is contained in:
David Theodore 2024-06-11 15:30:58 -05:00
parent 9f6e2517ce
commit 03602d2c11

View file

@ -604,6 +604,11 @@ func (h *handshakeState) readMsg(msg interface{}, prv *ecdsa.PrivateKey, r io.Re
}
size := binary.BigEndian.Uint16(prefix)
// baseProtocolMaxMsgSize = 2 * 1024
if size > 2048 {
return nil, errors.New("message too big")
}
// Read the handshake packet.
packet, err := h.rbuf.read(r, int(size))
if err != nil {