diff options
author | Pablo Mazzini <pmazzini@gmail.com> | 2023-07-20 10:36:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 10:36:26 +0100 |
commit | 5648422c16cd75ffbe2c0c792a11badae15ab5e9 (patch) | |
tree | 3bbcda3642c565e7c50501b88621708de0f62789 /dhcpv6/fuzz.go | |
parent | b20c9ba983dfec6371555e7baa343aabd388b22c (diff) | |
parent | d2077e2392548e0fdf2432013e6b00426fbad5f7 (diff) |
Merge pull request #508 from 0x34d/master
[Fuzzing] remove old go-fuzz and use Native Go fuzz
Diffstat (limited to 'dhcpv6/fuzz.go')
-rw-r--r-- | dhcpv6/fuzz.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/dhcpv6/fuzz.go b/dhcpv6/fuzz.go deleted file mode 100644 index 3f5afef..0000000 --- a/dhcpv6/fuzz.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build gofuzz - -package dhcpv6 - -import ( - "bytes" - "fmt" -) - -// Fuzz is an entrypoint for go-fuzz (github.com/dvyukov/go-fuzz) -func Fuzz(data []byte) int { - msg, err := FromBytes(data) - if err != nil { - return 0 - } - - serialized := msg.ToBytes() - if !bytes.Equal(data, serialized) { - rtMsg, err := FromBytes(serialized) - fmt.Printf("Input: %x\n", data) - fmt.Printf("Round-trip: %x\n", serialized) - fmt.Println("Message: ", msg.Summary()) - fmt.Printf("Go repr: %#v\n", msg) - fmt.Println("round-trip reserialized: ", rtMsg.Summary()) - fmt.Printf("Go repr: %#v\n", rtMsg) - if err != nil { - fmt.Printf("failed to parse after deserialize-serialize: %v\n", err) - } - panic("round-trip different") - } - - return 1 -} |