mirror of
https://github.com/jwetzell/artnet-go.git
synced 2026-08-21 14:48:59 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 207a18d18e | |||
| 2cb6487036 | |||
| 4efa58ee25 |
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Joel Wetzell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
go test fuzz v1
|
||||
[]byte("Art-Net\x00000000")
|
||||
+1
-1
@@ -33,7 +33,7 @@ func (atc *ArtTimeCode) GetID() [8]uint8 {
|
||||
}
|
||||
|
||||
func (atc *ArtTimeCode) UnmarshalBinary(data []byte) error {
|
||||
if len(data) < 14 {
|
||||
if len(data) < 19 {
|
||||
return errors.New("ArtTimeCode packet must be at least 14 bytes long")
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user