mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 19:19:57 +00:00
add: new go-fuzz targets
Signed-off-by: Arjun <pkillarjun@protonmail.com>
This commit is contained in:
@@ -254,3 +254,18 @@ func (u *UDP) EncodeLayers() ([]gopacket.SerializableLayer, error) {
|
||||
udpLayer.SetNetworkLayerForChecksum(ipLayers[0].(gopacket.NetworkLayer))
|
||||
return append(ipLayers, &udpLayer), nil
|
||||
}
|
||||
|
||||
func FuzzIPDecoder(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
ipDecoder := NewIPDecoder()
|
||||
ipDecoder.Decode(RawPacket{Data: data})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzICMPDecoder(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
icmpDecoder := NewICMPDecoder()
|
||||
icmpDecoder.Decode(RawPacket{Data: data})
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user