go-ping / ping

ICMP Ping library for Go
MIT License
1.33k stars 345 forks source link

Fixed-size ICMP message deserialisation #137

Closed CHTJonas closed 3 years ago

CHTJonas commented 3 years ago

We allocate a fixed-size 512-byte array into which ICMP messages are deserialised.

https://github.com/go-ping/ping/blob/b6486c6f1f2d7aa4e017c9571730d467c4d4a2b8/ping.go#L475

This causes message truncation for people who ping with a larger message size and needless memory pressure for people who ping with one that's smaller.