mirror of
https://github.com/aler9/gortsplib
synced 2025-10-17 04:31:00 +08:00
ensure unmarshaled entities can be marshaled back (#773)
This commit is contained in:
@@ -186,11 +186,14 @@ func FuzzRequestUnmarshal(f *testing.F) {
|
||||
f.Add(ca.byts)
|
||||
}
|
||||
|
||||
f.Fuzz(func(_ *testing.T, b []byte) {
|
||||
f.Fuzz(func(t *testing.T, b []byte) {
|
||||
var req Request
|
||||
err := req.Unmarshal(bufio.NewReader(bytes.NewBuffer(b)))
|
||||
if err == nil {
|
||||
req.Marshal() //nolint:errcheck
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = req.Marshal()
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user