From 207a18d18e2860fe5e1edf6dd6886dced08d1701 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sat, 23 May 2026 07:43:15 -0500 Subject: [PATCH] mess around with fuzzing --- dmx_test.go | 8 ++++++++ .../fuzz/FuzzArtTimeCodeUnmarshalBinary/690c02f88aedb646 | 2 ++ timecode_test.go | 8 ++++++++ 3 files changed, 18 insertions(+) create mode 100644 testdata/fuzz/FuzzArtTimeCodeUnmarshalBinary/690c02f88aedb646 diff --git a/dmx_test.go b/dmx_test.go index 6046e60..34c1006 100644 --- a/dmx_test.go +++ b/dmx_test.go @@ -113,3 +113,11 @@ func BenchmarkArtDmxMarshalBinary(b *testing.B) { } } } + +func FuzzArtDmxUnmarshalBinary(f *testing.F) { + f.Add([]byte{65, 114, 116, 45, 78, 101, 116, 0, 0, 80, 0, 14, 237, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) + f.Fuzz(func(t *testing.T, data []byte) { + artDmx := artnet.ArtDmx{} + artDmx.UnmarshalBinary(data) + }) +} diff --git a/testdata/fuzz/FuzzArtTimeCodeUnmarshalBinary/690c02f88aedb646 b/testdata/fuzz/FuzzArtTimeCodeUnmarshalBinary/690c02f88aedb646 new file mode 100644 index 0000000..b32315f --- /dev/null +++ b/testdata/fuzz/FuzzArtTimeCodeUnmarshalBinary/690c02f88aedb646 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("Art-Net\x00000000") diff --git a/timecode_test.go b/timecode_test.go index ed59da6..ac69166 100644 --- a/timecode_test.go +++ b/timecode_test.go @@ -121,3 +121,11 @@ func BenchmarkArtTimeCodeMarshalBinary(b *testing.B) { } } } + +func FuzzArtTimeCodeUnmarshalBinary(f *testing.F) { + f.Add([]byte{65, 114, 116, 45, 78, 101, 116, 0, 0, 151, 0, 14, 0, 0, 11, 17, 3, 0, 0}) + f.Fuzz(func(t *testing.T, data []byte) { + artTimeCode := artnet.ArtTimeCode{} + artTimeCode.UnmarshalBinary(data) + }) +}